Exemple #1
0
 public function body()
 {
     $m = $this->init_module(Utils_GenericBrowser::module_name(), null, 't1');
     $m->set_table_columns(array(array('name' => 'xxx', 'width' => 50), array('name' => 'xyz', 'width' => 50)));
     $m->add_row('xxx', '123');
     $m->add_row('sdasf', '567');
     $m->add_row('wwww', 'abc');
     $m->add_row('asgfs', 'bla bla');
     $m->add_row('test', 'adsad');
     $m->add_row('search', 'sjfksdfjdk');
     $m->add_row('search keyword', 'test');
     $m->add_row('ttttesst', 'djsdkdkdkd kskdk');
     $m->add_row('xxx', 'yyyy');
     $this->display_module($m);
     $m = $this->init_module(Utils_GenericBrowser::module_name(), null, 't2');
     $m->set_table_columns(array(array('name' => 'xxx', 'search' => 1)));
     $m->add_row('xxx');
     $m->add_row('sdasf');
     $m->add_row('wwww');
     $m->add_row('asgfs');
     $m->add_row('test');
     $m->add_row('search');
     $m->add_row('search keyword');
     $m->add_row('ttttesst');
     $m->add_row('xxxy');
     $this->display_module($m, array(true), 'automatic_display');
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/GenericBrowser/GenericBrowserInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/GenericBrowser/GenericBrowser_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/GenericBrowser/GenericBrowserCommon_0.php');
 }
Exemple #2
0
 public function body()
 {
     print "Wizard Test<hr>";
     $wizard = $this->init_module(Utils_Wizard::module_name());
     //get form
     $f =& $wizard->begin_page();
     $f->addElement('header', null, 'Welcome Page... ');
     $f->addElement('select', 'select_0', 'Jump to page', array(1 => '1', 2 => '2'));
     //method decides about jump to page
     $wizard->next_page(array($this, 'jump_page0'));
     //call method that generates form named 'test2'
     $this->page1($wizard->begin_page('page1'));
     //always jump to page 3
     $wizard->next_page(3);
     $f =& $wizard->begin_page();
     $f->addElement('header', null, 'Page 2');
     $f->addElement('text', 'page_2_input', 'page_2_input');
     $f->addRule('page_2_input', 'Required!', 'required');
     //jump to next page
     $wizard->next_page();
     $f =& $wizard->begin_page();
     $f->addElement('header', null, 'Yeah! you came from page 1 or 2');
     $wizard->next_page();
     //call wizard with process function specified as third arg
     $this->display_module($wizard, array(array($this, 'display_results')));
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Wizard/WizardInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Wizard/Wizard_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Wizard/WizardCommon_0.php');
 }
Exemple #3
0
 public function body()
 {
     $f = $this->init_module(Libs_QuickForm::module_name());
     $f->addElement('automulti', 'automul', 'Automulti test', array($this->get_type() . 'Common', 'automulti_search'), array('ble'), array($this->get_type() . 'Common', 'automulti_format'));
     $f->setDefaults(array('automul' => array(2, 3)));
     $f->addElement('autoselect', 'autosel', 'Autoselect test', array(1 => 1, 3 => 3, 8 => 8), array($this->get_type() . 'Common', 'autoselect_search'));
     $f->addElement('text', 'frozen', 'Frozen test');
     $f->addRule('frozen', 'required', 'required');
     $x = $f->addElement('timestamp', 'xxxyss', 'Date picker');
     print 'get(here is what was submited): ' . $x->getValue() . '<br>';
     print 'export: ' . $f->exportValue('xxxyss') . '<br>';
     $f->addRule('xxxyss', 'required rule not passed', 'required');
     $f->addElement('autocomplete', 'auto_test', 'Autocomplete', array($this->get_type() . 'Common', 'autocomplete'));
     $f->addElement('currency', 'cur', 'Currency');
     //		$f->setDefaults(array('xxxyss'=>time()));
     //		$f->freeze(array('xxxyss'));
     //		$f->setDefaults(array('cur'=>'1252341.22'));
     //		$f->addElement('commondata_group','xxx2','commondata_group', 'Countries',array('depth'=>2,'separator'=>'<br>','empty_option'=>true));
     $f->addElement('commondata', 'cd_country', 'commondata Country', 'Countries', array('empty_option' => true), array('id' => 'dddd1'));
     $f->addElement('commondata', 'cd_state', 'commondata State', array('Countries', 'cd_country'), array('empty_option' => true));
     $f->addElement('commondata', 'cd_city', 'commondata City', array('Countries', 'cd_country', 'cd_state'), array('id' => 'dddd3'));
     $f->addElement('commondata', 'cd_street', 'commondata street', array('Countries', 'cd_country', 'cd_state', 'cd_city'));
     $f->setDefaults(array('cd_country' => 'US'));
     //		$f->addRule('cd_city','required','required');
     //		print($x->getValue().'<br>');
     //		$f->freeze();
     $f->addElement('select', 'sel1', 'sel1', array('x' => 'x', 'y' => 'y'), array('id' => 'sel1'));
     $f->addElement('select', 'sel2', 'sel2', array(), array('id' => 'sel2'));
     $f->addElement('select', 'sel3', 'sel3', array(), array('id' => 'sel3'));
     $f->setDefaults(array('sel2' => 'y'));
     print 'freezing<hr>';
     $f->freeze(array('frozen'));
     Utils_ChainedSelectCommon::create('sel2', array('sel1'), 'modules/Tests/QuickForm/update_sel.php', null, $f->exportValue('sel2'));
     Utils_ChainedSelectCommon::create('sel3', array('sel1', 'sel2'), 'modules/Tests/QuickForm/update_sel.php', array('test' => 'finito '), $f->exportValue('sel3'));
     $select1[0] = 'Pop';
     $select1[1] = 'Classical';
     $select1[2] = 'Funeral doom';
     $f->addElement('select', 'sel11', 'sel11', $select1, array('id' => 'sel11'));
     $f->addElement('select', 'sel22', 'sel22', array(), array('id' => 'sel22'));
     $f->addElement('select', 'sel33', 'sel33', array(), array('id' => 'sel33'));
     Utils_ChainedSelectCommon::create('sel22', array('sel11'), 'modules/Tests/QuickForm/update_sel2.php', null, $f->exportValue('sel22'));
     Utils_ChainedSelectCommon::create('sel33', array('sel11', 'sel22'), 'modules/Tests/QuickForm/update_sel2.php', null, $f->exportValue('sel33'));
     $c1 = $f->createElement('checkbox', 'c1', 'c1_l', 'c1_t');
     $c2 = $f->createElement('checkbox', 'c2', 'c2_l', 'c2_t');
     $c3 = $f->createElement('checkbox', 'c3', 'c3_l', 'c3_t');
     $f->addGroup(array($c1, $c2, $c3), 'g', 'g_l');
     $f->add_array(array(array('type' => 'group', 'elems' => array(array('type' => 'checkbox', 'label' => 'c1_l', 'name' => 'c1', 'values' => 'c1_t', 'default' => 0), array('type' => 'checkbox', 'label' => 'c2_l', 'name' => 'c2', 'values' => 'c2_t', 'default' => 0)), 'label' => 'radio')));
     $f->addElement('submit', null, 'ok');
     if ($f->validate()) {
         print_r($f->exportValues());
     }
     $f->display();
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/QuickForm/QuickFormInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/QuickForm/QuickForm_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/QuickForm/QuickFormCommon_0.php');
 }
Exemple #4
0
 public function body()
 {
     print "Tooltip Test<hr>";
     print Utils_TooltipCommon::create('point mouse here', 'tip');
     //------------------------------ print out src
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Tooltip/Tooltip_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Tooltip/TooltipCommon_0.php');
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Tooltip/TooltipInstall.php');
 }
Exemple #5
0
 public function body()
 {
     print 'This is an example Attachment page.';
     $com = $this->init_module(Utils_Attachment::module_name(), array('grupa'));
     $this->display_module($com);
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Attachment/AttachmentInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Attachment/Attachment_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Attachment/AttachmentCommon_0.php');
 }
Exemple #6
0
 public function body()
 {
     print 'This is an example comment page.';
     $com = $this->init_module('Utils/Comment', 'test');
     $com->set_moderator(true);
     $com->set_per_page(3);
     $com->reply_on_comment_page(false);
     $com->tree_structure(true);
     $this->display_module($com);
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Comment/CommentInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Comment/Comment_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Comment/CommentCommon_0.php');
 }
Exemple #7
0
 public function body()
 {
     print 'This is an example page that uses Base/Lang module.<br>';
     print __('This text can be translated.') . '<br>';
     print __('This text can be translated.') . '<br>';
     print __('Here you can have some numbers: %d, %d, %d but you can still translate whole text.', array(2, 6, 3)) . '<br>';
     print '<hr>';
     print 'Translations for the following line were installed along with this module.<br>';
     print __('Hello world!');
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Lang/LangInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Lang/Lang_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Lang/LangCommon_0.php');
 }
Exemple #8
0
 public function body()
 {
     $tb = $this->init_module(Utils_TabbedBrowser::module_name());
     $tb->set_tab('Manage Users', array($this, 'xxx'), 'users');
     $tb->set_tab('Manage Companies', array($this, 'xxx'), 'companies');
     $tb->set_tab('Manage Sales Categories', array($this, 'xxx'), 'categories', true);
     $tb->set_tab('XXX', array($this, 'xxx'), 'xxx', true);
     $tb->start_tab('XXX');
     print 'xXX';
     $tb->end_tab();
     $this->display_module($tb);
     //		$tb->tag();
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/TabbedBrowser/TabbedBrowserInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/TabbedBrowser/TabbedBrowser_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/TabbedBrowser/TabbedBrowserCommon_0.php');
 }
Exemple #9
0
 public function body()
 {
     print '<table>';
     for ($row = 0; $row < 5; $row++) {
         print '<tr>';
         for ($column = 0; $column < 4; $column++) {
             $id = $row * 5 + $column + 1;
             print '<td>';
             //print_r($attr);
             Utils_ImageCommon::display_thumb("modules/Tests/Image/image_" . $id . ".jpg", 120);
             print '</td>';
         }
         print '</tr>';
     }
     print '</table>';
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Image/ImageInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Image/Image_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Image/ImageCommon_0.php');
 }
Exemple #10
0
    public function body()
    {
        $form = $this->init_module(Libs_QuickForm::module_name(), null, 'RBpicker_test');
        $form->addElement('multiselect', 'test', 'Test', array(1 => 0, 4 => 1, 7 => 2, 8 => 3));
        $form->addElement('submit', 'submit', 'Submit');
        $form->display();
        if ($form->validate()) {
            print_r($form->exportValues());
        }
        $rb1 = $this->init_module(Utils_RecordBrowser_RecordPicker::module_name());
        $this->display_module($rb1, array('contact', 'test', array('Tests_LeightboxCommon', 'TEST'), array('company_name' => 1), array('country' => true)));
        print $rb1->create_open_link('Click here!');
        Libs_LeightboxCommon::display('leightbox1', '<h1>Leightbox</h1>' . 'ble ble ble', 'Test header');
        print '<hr><a ' . Libs_LeightboxCommon::get_open_href('leightbox1') . '>leightbox container</a>
			</div>';
        //------------------------------ print out src
        print '<hr><b>Install</b><br>';
        $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Leightbox/LeightboxInstall.php');
        print '<hr><b>Main</b><br>';
        $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Leightbox/Leightbox_0.php');
        print '<hr><b>Common</b><br>';
        $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Leightbox/LeightboxCommon_0.php');
    }
Exemple #11
0
 public function body()
 {
     $f = $this->init_module(Libs_OpenFlashChart::module_name());
     $title = new OFC_Elements_Title(date("D M d Y"));
     $f->set_title($title);
     $bar = new OFC_Charts_Bar();
     $bar->set_values(array(9, 8, 7, 6, 5, 4, 3, 2, 1));
     $f->add_element($bar);
     $this->display_module($f);
     $f2 = $this->init_module(Libs_OpenFlashChart::module_name());
     $title = new OFC_Elements_Title(date("D M d Y"));
     $f2->set_title($title);
     $bar = new OFC_Charts_Bar_Glass();
     $data = array();
     for ($i = 1; $i < 10; $i++) {
         $data[] = rand() % 10;
     }
     $bar->set_values($data);
     $f2->add_element($bar);
     $bar = new OFC_Charts_Line();
     $data = array();
     for ($i = 1; $i < 10; $i++) {
         $data[] = rand() % 10;
     }
     $bar->set_values($data);
     $bar->set_colour('#FF0000');
     $f2->add_element($bar);
     $this->display_module($f2);
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/OpenFlashChart/OpenFlashChartInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/OpenFlashChart/OpenFlashChart_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/OpenFlashChart/OpenFlashChartCommon_0.php');
 }
Exemple #12
0
 public function src()
 {
     //------------------------------ print out src
     print '<hr><b>Install</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Callbacks/CallbacksInstall.php');
     print '<hr><b>Main</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Callbacks/Callbacks_0.php');
     print '<hr><b>Common</b><br>';
     $this->pack_module(Utils_CatFile::module_name(), 'modules/Tests/Callbacks/CallbacksCommon_0.php');
 }