81
bumciach
Re: how can i create and use xoops object handler in my module?
  • 2009/9/1 12:41

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Thanks for your reply Trabis.
Next question :) Is this way (adding 'fake' vars for object) and with XoopsModel can we do join more than the two tables?
Or better "manually" type in the SQL query for linking multiple tables and return data in a regular array without this object mapping?



82
bumciach
Re: how can i create and use xoops object handler in my module?
  • 2009/8/29 18:47

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


I have two related tables, which I would like to get data through XoopsPersistableObjectHandler.

class pfawlAutorHandler extends XoopsPersistableObjectHandler
{
    function 
getAutorzy($criteria=null)
    {
        
$osoba_handler xoops_getModuleHandler('osoba');
        
$this->field_link $osoba_handler->keyName;
        
$this->field_object "FKid_osoby";
        
$this->table_link $osoba_handler->table;
      
$ret $this->getByLink($criteria);
      return 
$ret;
    }
}

and my script
$autor_handler xoops_getmodulehandler('autor');
$objs $autor_handler->getAutorzy();


I can see in the logger that the SQL query is submitted correctly. Fired directly in the database returns the contents of both tables. But $objs contains the fields from only one table.
I do not know if this is possible (using getByLink method).



83
bumciach
Re: jqueryFileTree plugin with XoopsForm
  • 2009/8/27 14:27

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


A curious detail: my code doesn't work on Internet Explorer, because of declarations in addScript
'type' => 'application/x-javascript'


There should be 'text/javascript' not 'application/x-javascript'.



84
bumciach
Re: Jquery usefull plugins
  • 2009/8/27 12:16

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Dynatree looks nice!
I started to use the TreeView Plugin. And now I have the dilemma of what will be better;)



85
bumciach
Re: Having problem with xoops formdatetime
  • 2009/8/27 9:45

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


$bookings_date=$_REQUEST["bookings_date"];
$datetime strtotime($bookings_date['date']) + $bookings_date['time'];
$obj->setVar("bookings_datetime"$datetime);



86
bumciach
Re: XOOPS Modules GUI Standard Icons
  • 2009/8/27 9:35

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Oh... And I did not even know that there was agreement on the use of Crystal Icons :P
Ghia is right. If we consider this as standard, together with the XOOPS should be distributed basic set of Crystal Icons.
When I started to do a module, the first thing was to seek the appropriate icons in XOOPS / images. There were no icons for add, edit, delete, etc. operations. So I had to look for others.

It would be ideal if the selection of icons correspond to the themes. Then each webmaster could easily get their own site a consistent appearance.
I don't know as much in css, but perhaps, as does (for mimetypes icon) the Gumamela Theme
iconize.css
a[href$='.doc'],a[href$='.rtf'] {
background:transparent url(icons/icon_doc.gifno-repeat center right;
padding:5px 20px 5px 0;
}
...



87
bumciach
Re: Having problem with xoops formdatetime
  • 2009/8/27 8:52

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


It should be in one field... Did you try something like that?
$datetime strtotime($_REQUEST["bookings_date[date]"]) + $_REQUEST["bookings_date[time]"];
$obj->setVar("bookings_datetime"$datetime);



88
bumciach
jqueryFileTree plugin with XoopsForm
  • 2009/8/25 11:03

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Hello!
I did for my own purposes form element to set the directory (and path). But if somebody is interested in it any suggestions welcome. This is a very preliminary version (some things are hardcoded). Maybe it will be useful for someone.

I used jqueryFileTree plugin to display directories (it points uploads dir). After opening the folder the path is copied to the text box (can also be edited manually). The form sends the value of this textbox for further processing.

For demo download and install this module pfxfp.zip

/modules/pfxfp/class/formelement/formtextdirpath.php
class pf_XoopsFormDirPath extends XoopsFormText
{
    function 
pf_XoopsFormDirPath($caption$name$size 15$value0)
    {
        
//$value = !is_numeric($value) ? time() : intval($value);
        
$this->XoopsFormText($caption$name$size255$value);
        
$this->addScript();
    }
    
    function 
addScript()
    {
      global 
$xoTheme$xoopsModule;
      
$ele_name $this->getName();
      
$dirname XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname");
      
$xoTheme->addScript($dirname '/js/jqueryFileTree/jqueryFileTree.js');
    
$xoTheme->addStylesheet($dirname '/js/jqueryFileTree/jqueryFileTree.css');
      
$xoTheme->addScript(null, array( 'type' => 'application/x-javascript' ), '
        $(document).ready( function() {
            $('
#uploadsdir_'.$ele_name.'').fileTree({ 
              
root''.XOOPS_ROOT_PATH.'/uploads/',
              
script''.$dirname.'/js/jqueryFileTree/connectors/jqueryFileTree.php',
              
folderclicked: function(node) { $('#'.$ele_name.'').val(node);
     }
               },
              
              function(
file) {
                
alert(file);
            });
        });
    
');
  }

    function render()
    { 
        $ele_name = $this->getName();
        $ele_value = $this->getValue();
        return '
<div id="uploadsdir_'.$ele_name.'" style="height:200px;width:50%;border:1px solid #ccc;overflow:auto;"></div><input type="text" name="'.$ele_name.'" id="'.$ele_name.'" size="'.$this->getSize().'" value="'.$ele_value.'"'.$this->getExtra().' />';
    }
}


usage:
/modules/pfxfp/index.php
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
include_once(
PFXFP_ROOT_PATH."/class/formelement/formtextdirpath.php");
$form = new XoopsThemeForm('test''frmCategory''category.php');
        [...]

        
//DIRECTORY BROWSER
          
$form->addElement(new pf_XoopsFormDirPath('Destination''dbf_dir'50''), false); 

        [...]
        
$form->display();



89
bumciach
Re: Where is the Project Management Quality
  • 2009/8/20 7:38

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


It seems to me also that a better solution would be to have it all information in one place. At least the forum and wiki. Easier to maintain and less confusion.

The idea of dev.xoops.org has never been clear to me. Good only on our own svn and bugtracker for core and modules (but it is also on sourceforge.net).

But local support sites and individual sites devs are also important. However, we need better information exchange, wiki colaboration, etc. On many pages there are many interesting informations, code snippets, hacks, etc. There is no chance to know about that as a ordinary xoops.org user.



90
bumciach
Re: Ajax calls directly from Jquery
  • 2009/8/20 6:58

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Quote:

frankblack wrote:
Possible:
a) add a define for each file/function where jquery is used and IF defined do not load jquery.js again

In my modules I use wherever I need:
$xoTheme->addScript('/js/jquery-1.3.2.min.js');

It seems that the file is always loaded only once. Of course, other modules / blocks and themes can still load their duplicate libs.




TopTop
« 1 ... 6 7 8 (9) 10 11 12 ... 14 »



Login

Who's Online

151 user(s) are online (93 user(s) are browsing Support Forums)


Members: 0


Guests: 151


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits