From: <tr...@us...> - 2012-12-09 20:51:29
|
Revision: 10340 http://sourceforge.net/p/xoops/svn/10340 Author: trabis Date: 2012-12-09 20:51:26 +0000 (Sun, 09 Dec 2012) Log Message: ----------- adding codex module Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/cache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/form.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/images/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/images/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/images/logo.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/modinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/pdf.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/xoops_version.php Copied: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/cache.php (from rev 10329, XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/cache.php) =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/cache.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/cache.php 2012-12-09 20:51:26 UTC (rev 10340) @@ -0,0 +1,58 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +include dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); +if (isset($_GET['delete'])) { + Xoops_Cache::delete('mykey'); + Xoops_Cache::delete('mykey2', 'myfilesystem'); + Xoops_Cache::delete('mykey3', 'mymemcache'); +} + +$content = time(); + +//using 'default' cache file system +if (!$ret = Xoops_Cache::read('mykey')) { + Xoops_Cache::write('mykey', $content); + $ret = $content; +} +echo $ret . '<br />'; + +//setting new cache file system +Xoops_Cache::config('myfilesystem', array('engine' => 'file', 'duration' => 10)); +if (!$ret = Xoops_Cache::read('mykey2', 'myfilesystem')) { + $ret = Xoops_Cache::write('mykey2', $content, 'myfilesystem'); + $ret = $content; +} +echo $ret . '<br />'; + +//setting new cache memcache system +Xoops_Cache::config('mymemcache', array('engine' => 'memcache', 'duration' => 5)); +if (!$ret = Xoops_Cache::read('mykey3', 'mymemcache')) { + if(Xoops_Cache::write('mykey3', $content, 'mymemcache')) { + $ret = $content; + } else { + $ret = 'No Memcache, no bear'; + } +} +echo $ret . '<br />'; + +echo '<a href="?nodelete">Refresh</a> - <a href="?delete">Delete caches</a>'; +$xoops->footer(); Copied: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/form.php (from rev 10329, XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/form.php) =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/form.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/form.php 2012-12-09 20:51:26 UTC (rev 10340) @@ -0,0 +1,140 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +include dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); +// Form Horizontal +$form = new XoopsThemeForm('Form Horizontal', 'form_horizontal', 'testform.php', 'post', true, 'horizontal'); + +$code = new XoopsFormText('Code', 'code', 2, 25, '','Code...'); +$code->setDescription('Description code'); +$code->setPattern('^.{3,}$', 'You need at least 3 characters'); +$code->setDatalist(array('list 1','list 2','list 3')); +$form->addElement($code, true); + +$password = new XoopsFormPassword('Password', 'password', 3, 25, '', false, 'Your Password'); +$password->setDescription('Description password'); +$password->setPattern('^.{8,}$', 'You need at least 8 characters'); +$form->addElement($password, true); + +$description = new XoopsFormTextArea('Description', 'description', '', 5, 6, 'Your description'); +$description->setDescription('Put the description'); +$form->addElement($description, true); + +$description_2 = new XoopsFormDhtmlTextArea('Description_2', 'description_2', '', 6, 7); +$description_2->setDescription('Put the description_2'); +$form->addElement($description_2, true); + + +$form->addElement(new XoopsFormRadioYN('Yes or No', 'yesorno', 0), false); + +$radio_inline = new XoopsFormRadio('Radio Inline', 'radio_inline', 1, true); +$radio_inline->addOption(1, 'Radio Inline 1'); +$radio_inline->addOption(2, 'Radio Inline 2'); +$radio_inline->addOption(3, 'Radio Inline 3'); +$radio_inline->setDescription('Description Radio Inline'); +$form->addElement($radio_inline, false); + +$radio = new XoopsFormRadio('Radio', 'radio', 2, false); +$radio->addOption(1, 'Radio 1'); +$radio->addOption(2, 'Radio 2'); +$radio->addOption(3, 'Radio 3'); +$radio->setDescription('Description Radio'); +$form->addElement($radio, false); + +$checkbox_inline = new XoopsFormCheckbox('Checkbox Inline', 'checkbox_inline', 1, true); +$checkbox_inline->addOption(1, 'Checkbox Inline 1'); +$checkbox_inline->addOption(2, 'Checkbox Inline 2'); +$checkbox_inline->addOption(3, 'Checkbox Inline 3'); +$checkbox_inline->setDescription('Description Checkbox Inline'); +$form->addElement($checkbox_inline, true); + +$checkbox = new XoopsFormCheckbox('Checkbox', 'checkbox', 2, false); +$checkbox->addOption(1, 'Checkbox 1'); +$checkbox->addOption(2, 'Checkbox 2'); +$checkbox->addOption(3, 'Checkbox 3'); +$checkbox->setDescription('Description Checkbox'); +$form->addElement($checkbox, true); + +$label= new XoopsFormLabel('Label', 'label', 'label'); +$label->setDescription('Description Label'); +$form->addElement($label, true); + + +$color = new XoopsFormColorPicker('Color', 'color'); +$color->setDescription('Description Color'); +$form->addElement($color, true); + +$file = new XoopsFormFile('File', 'file', 500000); +$file->setDescription('Description File'); +$form->addElement($file, true); + +$select = new XoopsFormSelect('Select', 'select', '', 1, false); +$select->addOption(1, 'Select 1'); +$select->addOption(2, 'Select 2'); +$select->addOption(3, 'Select 3'); +$select->setDescription('Description Select'); +$select->setClass('span2'); +$form->addElement($select, true); + +$select_optgroup = new XoopsFormSelect('Select Optgroup', 'select_optgroup', '', 1, false); +$select_optgroup->addOptgroup('Swiss', array(1 => 'Geneva', 2 => 'Bern', 3 => 'Zurich')); +$select_optgroup->addOptgroup('France', array(4 => 'Paris', 5 => 'Lyon', 6 => 'Grenoble', 7 => 'Marseille')); +$select_optgroup->setDescription('Description Select Optgroup'); +$select_optgroup->setClass('span3'); +$form->addElement($select_optgroup, true); + +$date = new XoopsFormTextDateSelect('Date', 'date', 2,'','Date...'); +$date->setDescription('Description Date'); +$form->addElement($date, true); + +$date_time = new XoopsFormDateTime('Date time', 'date_time', 3,'','Date...'); +$date_time->setDescription('Description Date time'); +$form->addElement($date_time, true); + +$form->addElement(new XoopsFormCaptcha('Captcha', 'captcha', false), true); + +$testtray = new XoopsFormElementTray('Test tray'); +$select_tray = new XoopsFormSelect('Select_tray', 'select_tray', '', 4, true); +$select_tray->addOption(1, 'Select_tray 1'); +$select_tray->addOption(2, 'Select_tray 2'); +$select_tray->addOption(3, 'Select_tray 3'); +$select_tray->addOption(4, 'Select_tray 4'); +$select_tray->addOption(5, 'Select_tray 5'); +$select_tray->addOption(6, 'Select_tray 6'); +$select_tray->setDescription('Description Select_tray'); +$select_tray->setClass('span2'); +$testtray ->addElement($select_tray, true); +$testtray ->addElement($select_tray); +$form->addElement($testtray); + +$button = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); +$form->addElement($button); + +$button_2 = new XoopsFormButton('', 'reset', _RESET, 'reset'); +$button_2->setClass('btn btn-danger'); +$form->addElement($button_2); + +$button_tray = new XoopsFormButtonTray('button_tray', 'submit', _SUBMIT, '', true); +$button_tray->setClass('btn btn-inverse'); +$form->addElement($button_tray); + +$form->display(); +$xoops->footer(); \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/images/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/images/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/images/index.html 2012-12-09 20:51:26 UTC (rev 10340) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/images/logo.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/images/logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/index.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/index.php 2012-12-09 20:51:26 UTC (rev 10340) @@ -0,0 +1,30 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +include dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); +$files = XoopsLists::getFileListAsArray(dirname(__FILE__)); +foreach ($files as $file) { + if (!in_array($file, array('xoops_version.php', 'index.php'))) { + echo "<a href={$file}>{$file}</a><br/>"; + } +} + +$xoops->footer(); Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/index.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: svn:eol-style + native Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/index.html 2012-12-09 20:51:26 UTC (rev 10340) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/main.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/main.php 2012-12-09 20:51:26 UTC (rev 10340) @@ -0,0 +1,19 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/main.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: svn:eol-style + native Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/modinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/modinfo.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/language/english/modinfo.php 2012-12-09 20:51:26 UTC (rev 10340) @@ -0,0 +1,22 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +define('_MI_CODEX_NAME', 'Codex'); +define('_MI_CODEX_DSC', 'Code examples for developers'); \ No newline at end of file Property changes on: XoopsCore/branches/2.6. |