You can subscribe to this list here.
2012 |
Jan
|
Feb
(214) |
Mar
(139) |
Apr
(198) |
May
(187) |
Jun
(151) |
Jul
(210) |
Aug
(169) |
Sep
(58) |
Oct
(53) |
Nov
(54) |
Dec
(301) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2013 |
Jan
(348) |
Feb
(178) |
Mar
(219) |
Apr
(154) |
May
(117) |
Jun
(194) |
Jul
(61) |
Aug
(132) |
Sep
(121) |
Oct
(110) |
Nov
(11) |
Dec
(18) |
2014 |
Jan
(34) |
Feb
(50) |
Mar
(82) |
Apr
(98) |
May
(39) |
Jun
(111) |
Jul
(67) |
Aug
(36) |
Sep
(33) |
Oct
(26) |
Nov
(53) |
Dec
(44) |
2015 |
Jan
(29) |
Feb
(47) |
Mar
(25) |
Apr
(19) |
May
(23) |
Jun
(20) |
Jul
(49) |
Aug
(7) |
Sep
(10) |
Oct
(10) |
Nov
(4) |
Dec
(25) |
2016 |
Jan
(8) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(5) |
2017 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(15) |
Jun
|
Jul
(18) |
Aug
(24) |
Sep
|
Oct
(14) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
(22) |
Mar
|
Apr
(11) |
May
(1) |
Jun
(17) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(5) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <tr...@us...> - 2012-12-05 19:28:23
|
Revision: 10322 http://sourceforge.net/p/xoops/svn/10322 Author: trabis Date: 2012-12-05 19:28:19 +0000 (Wed, 05 Dec 2012) Log Message: ----------- Adding example for form Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/form.php Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/form.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/form.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/form.php 2012-12-05 19:28:19 UTC (rev 10322) @@ -0,0 +1,141 @@ +<?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(__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(); Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/form.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: svn:eol-style + native |
From: <tr...@us...> - 2012-12-05 19:25:13
|
Revision: 10321 http://sourceforge.net/p/xoops/svn/10321 Author: trabis Date: 2012-12-05 19:25:07 +0000 (Wed, 05 Dec 2012) Log Message: ----------- XoopsThemeForm::render method should allways return content. While display should display it. I also changed xoopsModulesAdmin to follow this logic. It is important to be consistent. Several modules/templates were updated Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/avatar_custom.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/avatar_system.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/templates/admin/avatars_custom.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/templates/admin/avatars_system.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/banners.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/clients.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_banners.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_clients.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/banners_client.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/send_mails.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/templates/admin/mailusers_send_mail.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_center.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_dump.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/content.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/permissions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/related.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/print.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/rating.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/admin/page_admin_content.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/admin/page_admin_related.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/viewpage.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/category.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/permissions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/step.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/user.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/visibility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/templates/admin/categorylist.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/templates/admin/fieldlist.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/templates/admin/steplist.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/admin/center.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/admin/prefix_manager.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/smilies/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/smilies/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/smilies/admin/smilies.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/smilies/templates/admin/smilies_smilies.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/groups/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/images/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/form/imagecat.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/system_blocks.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/system_blocks_item.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/system_comments.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/system_extensions.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/system_groups.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/system_preferences.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/system_users.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/testform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/userrank/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/userrank/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/userrank/admin/userrank.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/userrank/templates/admin/userrank.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/footer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/captcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/text.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/footer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/form/language.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -24,51 +24,63 @@ { /** * Set module directory + * * @var string */ public $_tplModule = 'system'; /** * Template call for each render parts + * * @var array */ - public $_tplFile = array('index' => 'admin_index.html', 'about' => 'admin_about.html', 'infobox' => 'admin_infobox.html', 'bread' => 'admin_breadcrumb.html', 'button' => 'admin_buttons.html', 'tips' => 'admin_tips.html', 'nav' => 'admin_navigation.html'); + public $_tplFile = array( + 'index' => 'admin_index.html', 'about' => 'admin_about.html', 'infobox' => 'admin_infobox.html', + 'bread' => 'admin_breadcrumb.html', 'button' => 'admin_buttons.html', 'tips' => 'admin_tips.html', + 'nav' => 'admin_navigation.html' + ); /** * Tips to display in admin page + * * @var string */ private $_tips = ''; /** * List of button + * * @var array */ private $_itemButton = array(); /** * List of Info Box + * * @var array */ private $_itemInfoBox = array(); /** * List of line of an Info Box + * * @var array */ private $_itemConfigBoxLine = array(); /** * Breadcrumb data + * * @var array */ private $_bread = array(); /** * Current module object - * @var #P#M#C\Xoops.getInstance.module|array|? + * + * @var XoopsModule $_obj */ - private $_obj = array(); + private $_obj = null; /** * Constructor @@ -82,31 +94,31 @@ /** * Add breadcrumb menu + * * @param string $title * @param string $link - * @param bool $home + * @param bool $home */ public function addBreadcrumbLink($title = '', $link = '', $home = false) { if ($title != '') { $this->_bread[] = array( - 'link' => $link, - 'title' => $title, - 'home' => $home + 'link' => $link, 'title' => $title, 'home' => $home ); } } /** * Add config line + * * @param string $value * @param string $type + * * @return bool */ public function addConfigBoxLine($value = '', $type = 'default') { - switch ($type) - { + switch ($type) { default: case "default": $this->_itemConfigBoxLine[] = array('type' => $type, 'text' => $value); @@ -114,22 +126,32 @@ case "folder": if (!is_dir($value)) { - $this->_itemConfigBoxLine[] = array('type' => 'error', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_FOLDERKO, $value)); + $this->_itemConfigBoxLine[] = array( + 'type' => 'error', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_FOLDERKO, $value) + ); } else { - $this->_itemConfigBoxLine[] = array('type' => 'accept', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_FOLDEROK, $value)); + $this->_itemConfigBoxLine[] = array( + 'type' => 'accept', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_FOLDEROK, $value) + ); } break; case "chmod": if (is_dir($value[0])) { if (substr(decoct(fileperms($value[0])), 2) != $value[1]) { - $this->_itemConfigBoxLine[] = array('type' => 'error', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_CHMOD, $value[0], $value[1], substr(decoct(fileperms($value[0])), 2))); + $this->_itemConfigBoxLine[] = array( + 'type' => 'error', + 'text' => sprintf(_AM_MODULEADMIN_CONFIG_CHMOD, $value[0], $value[1], substr(decoct(fileperms($value[0])), 2)) + ); } else { - $this->_itemConfigBoxLine[] = array('type' => 'accept', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_CHMOD, $value[0], $value[1], substr(decoct(fileperms($value[0])), 2))); + $this->_itemConfigBoxLine[] = array( + 'type' => 'accept', + 'text' => sprintf(_AM_MODULEADMIN_CONFIG_CHMOD, $value[0], $value[1], substr(decoct(fileperms($value[0])), 2)) + ); } } break; - + case "extension": $xoops = Xoops::getInstance(); if (is_array($value)) { @@ -140,9 +162,13 @@ $type = 'error'; } if ($xoops->isActiveModule($text) == false) { - $this->_itemConfigBoxLine[] = array('type' => $type, 'text' => sprintf(_AM_MODULEADMIN_CONFIG_EXTENSIONKO, $text)); + $this->_itemConfigBoxLine[] = array( + 'type' => $type, 'text' => sprintf(_AM_MODULEADMIN_CONFIG_EXTENSIONKO, $text) + ); } else { - $this->_itemConfigBoxLine[] = array('type' => 'accept', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_EXTENSIONOK, $text)); + $this->_itemConfigBoxLine[] = array( + 'type' => 'accept', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_EXTENSIONOK, $text) + ); } break; @@ -156,9 +182,13 @@ $type = 'error'; } if ($xoops->isActiveModule($text) == false) { - $this->_itemConfigBoxLine[] = array('type' => $type, 'text' => sprintf(_AM_MODULEADMIN_CONFIG_MODULEKO, $text)); + $this->_itemConfigBoxLine[] = array( + 'type' => $type, 'text' => sprintf(_AM_MODULEADMIN_CONFIG_MODULEKO, $text) + ); } else { - $this->_itemConfigBoxLine[] = array('type' => 'accept', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_MODULEOK, $text)); + $this->_itemConfigBoxLine[] = array( + 'type' => 'accept', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_MODULEOK, $text) + ); } break; } @@ -167,9 +197,11 @@ /** * Add Info box - * @param $title + * + * @param $title * @param string $type * @param string $extra + * * @return bool */ public function addInfoBox($title, $type = 'default', $extra = '') @@ -183,9 +215,11 @@ /** * Add line to the info box + * * @param string $text * @param string $type * @param string $color + * * @return bool */ public function addInfoBoxLine($text = '', $type = 'default', $color = 'inherit') @@ -199,17 +233,18 @@ $this->_itemInfoBox[$i]['line'][] = $ret; unset($ret); } - } return true; } /** * Add Item button - * @param $title - * @param $link + * + * @param $title + * @param $link * @param string $icon * @param string $extra + * * @return bool */ public function addItemButton($title, $link, $icon = 'add', $extra = '') @@ -224,6 +259,7 @@ /** * Add a tips + * * @param string $text */ public function addTips($text = '') @@ -233,7 +269,9 @@ /** * Construct template path + * * @param string $type + * * @return string */ private function getTplPath($type = '') @@ -244,44 +282,57 @@ public function renderBreadcrumb() { $xoops = Xoops::getInstance(); - $xoops->tpl->assign('xo_admin_breadcrumb', $this->_bread); - //$xoops->tpl->assign('xo_admin_help', $this->_help); - if ($xoops->tpl_name == '') { - $xoops->tpl->display($this->getTplPath('bread')); - } + return $xoops->tpl->fetch($this->getTplPath('bread')); } + public function displayBreadcrumb() + { + echo $this->renderBreadcrumb(); + } + /** * Render all items buttons + * * @param string $position - * @param string $delimeter + * @param string $delimiter + * * @return string */ - public function renderButton($position = "floatright", $delimeter = " ") + public function renderButton($position = "floatright", $delimiter = " ") { $xoops = Xoops::getInstance(); $xoops->tpl->assign('xo_admin_buttons_position', $position); - $xoops->tpl->assign('xo_admin_buttons_delim', $delimeter); + $xoops->tpl->assign('xo_admin_buttons_delim', $delimiter); $xoops->tpl->assign('xo_admin_buttons', $this->_itemButton); - if ($xoops->tpl_name == '') { - $xoops->tpl->display($this->getTplPath('button')); - } + return $xoops->tpl->fetch($this->getTplPath('button')); } /** + * @param string $position + * @param string $delimiter + */ + public function displayButton($position = "floatright", $delimiter = " ") + { + echo $this->renderButton($position, $delimiter); + } + + /** * Render InfoBox */ public function renderInfoBox() { $xoops = Xoops::getInstance(); $xoops->tpl->assign('xo_admin_box', $this->_itemInfoBox); - if ($xoops->tpl_name == '') { - $xoops->tpl->display($this->getTplPath('infobox')); - } + return $xoops->tpl->fetch($this->getTplPath('infobox')); } + public function displayInfoBox() + { + echo $this->renderInfoBox(); + } + /** * Render index page for admin */ @@ -290,7 +341,7 @@ $xoops = Xoops::getInstance(); $this->_obj->loadAdminMenu(); foreach (array_keys($this->_obj->adminmenu) as $i) { - if ( file_exists($xoops->path("/media/xoops/images/icons/32/" . $this->_obj->adminmenu[$i]['icon']) ) ) { + if (file_exists($xoops->path("/media/xoops/images/icons/32/" . $this->_obj->adminmenu[$i]['icon']))) { $this->_obj->adminmenu[$i]['icon'] = $xoops->url("/media/xoops/images/icons/32/" . $this->_obj->adminmenu[$i]['icon']); } else { $this->_obj->adminmenu[$i]['icon'] = $xoops->url("/modules/" . $xoops->module->dirname() . "/icons/32/" . $this->_obj->adminmenu[$i]['icon']); @@ -327,7 +378,6 @@ $dbCurrentVersion = mysqli_get_server_info(); break; case "pdo": - global $xoopsDB; $dbCurrentVersion = $xoops->db->getAttribute(PDO::ATTR_SERVER_VERSION); break; default: @@ -367,50 +417,73 @@ } $xoops->tpl->assign('xo_admin_index_config', $this->_itemConfigBoxLine); } - $xoops->tpl->display($this->getTplPath('index')); + return $xoops->tpl->fetch($this->getTplPath('index')); } + public function displayIndex() + { + echo $this->renderIndex(); + } + /** * Render navigation to admin page + * * @param string $menu + * + * @return array */ - function renderNavigation($menu = '') + public function renderNavigation($menu = '') { $xoops = Xoops::getInstance(); + $ret = array(); $this->_obj->loadAdminMenu(); foreach (array_keys($this->_obj->adminmenu) as $i) { if ($this->_obj->adminmenu[$i]['link'] == "admin/" . $menu) { - if ( file_exists($xoops->path("/media/xoops/images/icons/32/" . $this->_obj->adminmenu[$i]['icon']) ) ) { + if (file_exists($xoops->path("/media/xoops/images/icons/32/" . $this->_obj->adminmenu[$i]['icon']))) { $this->_obj->adminmenu[$i]['icon'] = $xoops->url("/media/xoops/images/icons/32/" . $this->_obj->adminmenu[$i]['icon']); } else { $this->_obj->adminmenu[$i]['icon'] = $xoops->url("/modules/" . $xoops->module->dirname() . "/icons/32/" . $this->_obj->adminmenu[$i]['icon']); } $xoops->tpl->assign('xo_sys_navigation', $this->_obj->adminmenu[$i]); - if ($xoops->tpl_name == '') { - $xoops->tpl->display($this->getTplPath('nav')); - } + $ret[] = $xoops->tpl->fetch($this->getTplPath('nav')); } } + return $ret; } /** + * @param string $menu + */ + public function displayNavigation($menu = '') + { + $items = $this->renderNavigation($menu); + foreach ($items as $item) { + echo $item; + } + } + + /** * Render tips to admin page */ public function renderTips() { $xoops = Xoops::getInstance(); - $xoops->tpl->assign('xo_admin_tips', $this->_tips); - if ($xoops->tpl_name == '') { - $xoops->tpl->display($this->getTplPath('tips')); - } + return $xoops->tpl->fetch($this->getTplPath('tips')); } + public function displayTips() + { + echo $this->renderTips(); + } + /** * Render about page - * @param string $paypal + * * @param bool $logo_xoops + * + * @return bool|mixed|string */ public function renderAbout($logo_xoops = true) { @@ -431,11 +504,11 @@ } } $changelog = ''; - $language = $GLOBALS['xoopsConfig']['language']; + $language = $xoops->getConfig('language'); if (!is_file(XOOPS_ROOT_PATH . "/modules/" . $this->_obj->getVar("dirname") . "/language/" . $language . "/changelog.txt")) { $language = 'english'; } - $language = empty($language) ? $GLOBALS['xoopsConfig']['language'] : $language; + $language = empty($language) ? $xoops->getConfig('language') : $language; $file = XOOPS_ROOT_PATH . "/modules/" . $this->_obj->getVar("dirname") . "/language/" . $language . "/changelog.txt"; if (is_readable($file)) { $changelog = utf8_encode(implode("<br />", file($file))) . "\n"; @@ -449,8 +522,8 @@ $this->_obj->setInfo('release_date', $release_date); $this->_obj->setInfo('author_list', $author_list); - if (is_array($this->_obj->getInfo('paypal'))) { - $this->_obj->setInfo('paypal', $this->_obj->getInfo('paypal')); + if (is_array($this->_obj->getInfo('paypal'))) { + $this->_obj->setInfo('paypal', $this->_obj->getInfo('paypal')); } $this->_obj->setInfo('changelog', $changelog); $xoops->tpl->assign('module', $this->_obj); @@ -463,6 +536,14 @@ $xoops->tpl->assign('xoops_logo', $logo_xoops); $xoops->tpl->assign('xo_admin_box', $this->_itemInfoBox); - $xoops->tpl->display($this->getTplPath('about')); + return $xoops->tpl->fetch($this->getTplPath('about')); } + + /** + * @param bool $logo_xoops + */ + public function displayAbout($logo_xoops = true) + { + echo $this->renderAbout($logo_xoops); + } } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -52,9 +52,8 @@ /** * create HTML to output the form as a theme-enabled table with validation. - * @param bool $template */ - public function render($template = true) + public function render() { $xoops = Xoops::getInstance(); $xoops->theme->addStylesheet('media/xoops/css/form.css'); @@ -98,13 +97,13 @@ } else { $hidden .= $ele->render(). NWLINE; } - + } $xoops->tpl->assign('hidden', $hidden); $xoops->tpl->assign('validationJS', $this->renderValidationJS(true)); - if ($xoops->tpl_name == '' || $template == false) { - $xoops->tpl->display('module:system|system_form.html'); - $xoops->tpl->clear_assign('xo_input'); - } + $ret = $xoops->tpl->fetch('module:system|system_form.html'); + $xoops->tpl->clear_assign('xo_input'); + return $ret; + } } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/about.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/about.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/about.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -20,8 +20,9 @@ * @version $Id$ */ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); $xoops->header(); $aboutAdmin = new XoopsModuleAdmin(); -$aboutAdmin->renderNavigation('about.php'); -$aboutAdmin->renderabout('6KJ7RW5DR3VTJ', true); +$aboutAdmin->displayNavigation('about.php'); +$aboutAdmin->displayAbout('6KJ7RW5DR3VTJ', true); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/avatar_custom.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/avatar_custom.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/avatar_custom.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -22,10 +22,8 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); + // Parameters $nb_avatars = $xoops->getModuleConfig('avatars_pager'); $mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'); @@ -53,6 +51,7 @@ $admin_page->addTips(_AM_AVATARS_CUSTOM_TIPS); $admin_page->renderTips(); + // Get start pager $start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); // Filter avatars Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/avatar_system.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/avatar_system.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/avatar_system.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -22,10 +22,7 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); // Parameters $nb_avatars = $xoops->getModuleConfig('avatars_pager'); $mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'); @@ -92,8 +89,7 @@ $obj = $avatar_Handler->create(); $form = $xoops->getModuleForm($obj, 'avatar'); // Assign form - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; // Edit @@ -107,8 +103,7 @@ $obj = $avatar_Handler->get($system->cleanVars($_REQUEST, 'avatar_id', 0, 'int')); $form = $xoops->getModuleForm($obj, 'avatar'); // Assign form - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; // Save @@ -146,8 +141,7 @@ } $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'avatar'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; //Delete Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/index.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/index.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -21,6 +21,7 @@ */ include dirname(__FILE__) . '/header.php'; // Get avatars handler +$xoops = Xoops::getInstance(); $avatar_Handler = $xoops->getHandlerAvatar(); $xoops->header(); @@ -67,6 +68,6 @@ $admin_page->addConfigBoxLine($folder_path, 'folder'); $admin_page->addConfigBoxLine(array($folder_path, '777'), 'chmod'); -$admin_page->renderIndex(); +$admin_page->displayIndex(); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/templates/admin/avatars_custom.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/templates/admin/avatars_custom.html 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/templates/admin/avatars_custom.html 2012-12-05 19:25:07 UTC (rev 10321) @@ -46,6 +46,4 @@ </div> <{/if}> <!-- Display Avatar form (add,edit) --> -<{if $form}> -<div class="spacer"><{$form}></div> -<{/if}> \ No newline at end of file +<{$form}> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/templates/admin/avatars_system.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/templates/admin/avatars_system.html 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/templates/admin/avatars_system.html 2012-12-05 19:25:07 UTC (rev 10321) @@ -44,6 +44,4 @@ </div> <{/if}> <!-- Display Avatar form (add,edit) --> -<{if $form}> -<{includeq file="module:system|system_form.html"}> -<{/if}> \ No newline at end of file +<{$form}> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/about.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/about.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/about.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -20,8 +20,9 @@ * @version $Id$ */ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); $xoops->header(); $aboutAdmin = new XoopsModuleAdmin(); -$aboutAdmin->renderNavigation('about.php'); -$aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', true); +$aboutAdmin->displayNavigation('about.php'); +$aboutAdmin->displayAbout('6KJ7RW5DR3VTJ', true); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/banners.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/banners.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/banners.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -22,10 +22,7 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); // Parameters $nb_banners = $xoops->getModuleConfig('banners_pager'); $mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png', 'application/x-shockwave-flash'); @@ -200,8 +197,7 @@ $admin_page->renderButton(); $obj = $banner_Handler->create(); $form = $xoops->getModuleForm($obj, 'banner'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; case 'edit': @@ -213,8 +209,7 @@ if ($bid > 0) { $obj = $banner_Handler->get($bid); $form = $xoops->getModuleForm($obj, 'banner'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); } else { $xoops->redirect('banners.php', 1, _AM_SYSTEM_DBERROR); } @@ -264,8 +259,7 @@ } $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'banner'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; case 'delete': @@ -330,5 +324,5 @@ } $xoops->error($obj->getHtmlErrors()); break; -} +} $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/clients.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/clients.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/clients.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -21,15 +21,13 @@ */ include dirname(__FILE__) . '/header.php'; -// Get main instance +// Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); + // Parameters $nb_clients = $xoops->getModuleConfig('banners_clientspager'); -// Get Action type +// Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'default', 'string'); // Get banners handler $banner_Handler = $xoops->getModuleHandler('banner'); @@ -114,8 +112,7 @@ $admin_page->renderButton(); $obj = $client_Handler->create(); $form = $xoops->getModuleForm($obj, 'bannerclient'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; case 'edit': @@ -127,8 +124,7 @@ if ($cid > 0) { $obj = $client_Handler->get($cid); $form = $xoops->getModuleForm($obj, 'bannerclient'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); } else { $xoops->redirect('clients.php', 1, _AM_SYSTEM_DBERROR); } @@ -156,8 +152,7 @@ } $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'bannerclient'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; case 'delete': @@ -201,5 +196,5 @@ $xoops->redirect('clients.php', 1, _AM_SYSTEM_DBERROR); } break; -} +} $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/index.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/index.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -20,19 +20,20 @@ * @version $Id$ */ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); // Get banners handler $banner_Handler = $xoops->getModuleHandler('banner'); -$client_Handler = $xoops->getModuleHandler('bannerclient'); +$client_Handler = $xoops->getModuleHandler('bannerclient'); // heaser $xoops->header(); // banners $criteria = new CriteriaCompo(); $criteria->add(new Criteria('status', 0, '!=')); $banners_banner = $banner_Handler->getCount($criteria); -// banner clients +// banner clients $criteria = new CriteriaCompo(); $banners_client = $client_Handler->getCount($criteria); -// banner finish +// banner finish $criteria = new CriteriaCompo(); $criteria->add(new Criteria('status', 0)); $banners_finish = $banner_Handler->getCount($criteria); @@ -46,6 +47,6 @@ $admin_page->addInfoBoxLine(sprintf(_AM_BANNERS_INDEX_NBFINISH, '<span class="red">' . $banners_finish . '</span>')); $admin_page->addConfigBoxLine($folder_path, 'folder'); $admin_page->addConfigBoxLine(array($folder_path, '777'), 'chmod'); -$admin_page->renderNavigation('index.php'); -$admin_page->renderIndex(); +$admin_page->displayNavigation('index.php'); +$admin_page->displayIndex(); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/index.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/index.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -42,7 +42,7 @@ default: $access = false; $admin = false; - if (is_object($xoops->user)) { + if ($xoops->isUser()) { $uid = $xoops->user->getVar('uid'); } else { $uid = 0; @@ -56,7 +56,7 @@ if ($client_count != 0) { $access = true; } - if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) { + if ($xoops->userIsAdmin) { $access = true; $admin = true; } @@ -238,7 +238,7 @@ case 'edit': $access = false; $admin = false; - if (is_object($xoops->user)) { + if ($xoops->isUser()) { $uid = $xoops->user->getVar('uid'); } else { $uid = 0; @@ -252,7 +252,7 @@ if ($client_count != 0) { $access = true; } - if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) { + if ($xoops->userIsAdmin) { $access = true; $admin = true; } @@ -269,8 +269,7 @@ $form->addElement(new XoopsFormHidden('op', 'save')); $form->addElement(new XoopsFormHidden('bid', $obj->getVar('bid'))); $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); $xoops->footer(); } else { $xoops->redirect(XOOPS_URL, 1, _MD_BANNERS_INDEX_DBERROR); @@ -280,7 +279,7 @@ case 'save': $access = true; $admin = false; - if (is_object($xoops->user)) { + if ($xoops->isUser()) { $uid = $xoops->user->getVar('uid'); } else { $uid = 0; @@ -288,7 +287,7 @@ if ($uid == 0) { $access = false; } - if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) { + if ($xoops->userIsAdmin) { $access = true; $admin = true; } @@ -324,7 +323,7 @@ case 'EmailStats': $access = true; $admin = false; - if (is_object($xoops->user)) { + if ($xoops->isUser()) { $uid = $xoops->user->getVar('uid'); } else { $uid = 0; @@ -332,7 +331,7 @@ if ($uid == 0) { $access = false; } - if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) { + if ($xoops->userIsAdmin) { $access = true; $admin = true; } @@ -397,7 +396,7 @@ if ($banner) { if ($xoops->security->checkReferer()) { $banner->setVar('clicks', $banner->getVar('clicks') + 1); - $xoops->getHandlerBanner()->insert($banner); + $banner_Handler->insert($banner); header('Location: ' . $banner->getVar('clickurl')); exit(); } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_banners.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_banners.html 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_banners.html 2012-12-05 19:25:07 UTC (rev 10321) @@ -100,6 +100,4 @@ <!--Pop-pup--> <{/if}> <!-- Display form (add,edit) --> -<{if $form}> -<{includeq file="module:system|system_form.html"}> -<{/if}> \ No newline at end of file +<{$form}> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_clients.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_clients.html 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_clients.html 2012-12-05 19:25:07 UTC (rev 10321) @@ -8,9 +8,9 @@ <tr> <th class="txtcenter width15"><{$smarty.const._AM_BANNERS_CLIENTS_NAME}></th> <th class="txtcenter width15"><{$smarty.const._AM_BANNERS_CLIENTS_UNAME}></th> - <th class="txtcenter width10"><{$smarty.const._AM_BANNERS_CLIENTS_ACTIVEBANNERS}></th> + <th class="txtcenter width10"><{$smarty.const._AM_BANNERS_CLIENTS_ACTIVEBANNERS}></th> <th class="txtcenter"><{$smarty.const._AM_BANNERS_CLIENTS_MAIL}></th> - <th class="txtcenter width10"><{$smarty.const._AM_BANNERS_ACTION}></th> + <th class="txtcenter width10"><{$smarty.const._AM_BANNERS_ACTION}></th> </tr> </thead> <tbody> @@ -22,7 +22,7 @@ <{else}> <td class="txtcenter"><a title="<{$client.uname}>" href="<{$xoops_url}>/userinfo.php?uid=<{$client.uid}>" ><{$client.uname}></a></td> <{/if}> - <td class="txtcenter"><{$client.banner_active}></td> + <td class="txtcenter"><{$client.banner_active}></td> <td class="txtcenter"><{$client.email}></td> <td class="xo-actions txtcenter"> <img onclick="display_dialog(<{$client.cid}>, true, true, 'slide', 'slide', 250, 400);" src="<{xoAdminIcons display.png}>" alt="<{$smarty.const._AM_BANNERS_VIEW}>" title="<{$smarty.const._AM_BANNERS_VIEW}>" /> @@ -75,6 +75,4 @@ <!--Pop-pup--> <{/if}> <!-- Display form (add,edit) --> -<{if $form}> -<{includeq file="module:system|system_form.html"}> -<{/if}> +<{$form}> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/banners_client.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/banners_client.html 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/banners_client.html 2012-12-05 19:25:07 UTC (rev 10321) @@ -63,7 +63,7 @@ <th class="txtcenter"><{$smarty.const._AM_BANNERS_BANNERS_STARTDATE}></th> <th class="txtcenter"><{$smarty.const._AM_BANNERS_BANNERS_ENDDATE}></th> <th class="txtcenter width10"><{$smarty.const._AM_BANNERS_BANNERS_CLICKS}></th> - <th class="txtcenter width10"><{$smarty.const._AM_BANNERS_BANNERS_NCLICKS}></th> + <th class="txtcenter width10"><{$smarty.const._AM_BANNERS_BANNERS_NCLICKS}></th> <th class="txtcenter width10"><{$smarty.const._AM_BANNERS_ACTION}></th> </tr> </thead> @@ -108,6 +108,4 @@ <!--Pop-pup--> <{/if}> <!-- Display form (edit) --> -<{if $form}> -<{includeq file="module:system|system_form.html"}> -<{/if}> \ No newline at end of file +<{$form}> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/about.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/about.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/about.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -20,8 +20,9 @@ * @version $Id$ */ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); $xoops->header(); $aboutAdmin = new XoopsModuleAdmin(); -$aboutAdmin->renderNavigation('about.php'); -$aboutAdmin->renderabout('6KJ7RW5DR3VTJ', true); +$aboutAdmin->displayNavigation('about.php'); +$aboutAdmin->displayAbout('6KJ7RW5DR3VTJ', true); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/index.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/index.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -22,17 +22,17 @@ include dirname(__FILE__) . '/header.php'; - +$xoops = Xoops::getInstance(); $xoops->header(); $admin_page = new XoopsModuleAdmin(); -$admin_page->renderNavigation('index.php'); +$admin_page->displayNavigation('index.php'); //global $xoopsModuleConfig; $xmcMailusers = $xoops->getModuleConfigs('mailusers'); $admin_page->addInfoBox(_MI_MAILUSERS_MAILUSER_MANAGER); - + $tplString = "%1\$s : <span class='red'>%2\$s</span>"; $admin_page->addInfoBoxLine(sprintf($tplString,_AM_MAILUSERS_MAILFROM,$xmcMailusers['from'])); @@ -41,7 +41,7 @@ $admin_page->addInfoBoxLine(sprintf($tplString,_AM_MAILUSERS_SMTPHOST, implode(';', $xmcMailusers['smtphost']))); $admin_page->addInfoBoxLine(sprintf($tplString,_AM_MAILUSERS_SMTPUSER,$xmcMailusers['smtpuser'])); -$admin_page->renderIndex(); +$admin_page->displayIndex(); $xoops->footer(); @@ -57,5 +57,5 @@ - - + + Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/send_mails.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/send_mails.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/send_mails.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -20,16 +20,9 @@ * @version $Id$ */ -include_once ("header.php"); - -defined('XOOPS_ROOT_PATH') or die('Restricted access'); +include_once dirname(__FILE__) . '/header.php'; - -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} - +$xoops = Xoops::getInstance(); // Parameters $limit = 100; // Get Action type @@ -54,7 +47,7 @@ case 'list': default: - $display_criteria = 1; + $display_criteria = 1; $form = new XoopsThemeForm(_AM_MAILUSERS_LIST, "mailusers", "send_mails.php", 'post', true); //---------------------------------------- if (!empty($_POST['memberslist_id'])) { @@ -106,7 +99,7 @@ $inactive_cbox = new XoopsFormCheckBox('', "mail_inactive"); $inactive_cbox->addOption(1, _AM_MAILUSERS_INACTIVE . '<span class="bold green">*</span>'); $inactive_cbox->setExtra("onclick='javascript:disableElement(\"mail_lastlog_min\");disableElement(\"mail_lastlog_max\");disableElement(\"mail_idle_more\");disableElement(\"mail_idle_less\");disableElement(\"mail_to_group[]\");'"); - + $criteria_tray = new XoopsFormElementTray(_AM_MAILUSERS_SENDTOUSERS, "<br /><br />"); $criteria_tray->setDescription('<span class="bold green">*</span>' . _AM_MAILUSERS_OPTIONAL); $criteria_tray->addElement($group_select); @@ -157,14 +150,12 @@ $form->addElement($submit_button); $form->setRequired($subject_text); $form->setRequired($body_text); - - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; // Send case 'send': - + if (!empty($_POST['mail_send_to'])) { $added = array(); $added_id = array(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/templates/admin/mailusers_send_mail.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/templates/admin/mailusers_send_mail.html 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/templates/admin/mailusers_send_mail.html 2012-12-05 19:25:07 UTC (rev 10321) @@ -8,6 +8,4 @@ <{includeq file="admin:system|admin_tips.html"}> <{includeq file="admin:system|admin_buttons.html"}> -<{if $form}> -<{includeq file="module:system|system_form.html"}> -<{/if}> \ No newline at end of file +<{$form}> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/about.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/about.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/about.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -21,8 +21,9 @@ */ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); $xoops->header(); $aboutAdmin = new XoopsModuleAdmin(); -$aboutAdmin->renderNavigation('about.php'); -$aboutAdmin->renderabout('6KJ7RW5DR3VTJ', true); +$aboutAdmin->displayNavigation('about.php'); +$aboutAdmin->displayAbout('6KJ7RW5DR3VTJ', true); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -23,11 +23,8 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} -$system = System::getInstance(); +$xoops = Xoops::getInstance(); + // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); @@ -46,7 +43,7 @@ $admin_page->renderTips(); $form = $xoops->getModuleForm(null, 'maintenance'); $form->getMaintenance(); - $form->render(); + $form->display(); break; case 'maintenance_save': @@ -59,7 +56,7 @@ $tables_op = $system->cleanVars($_REQUEST, 'maintenance', array(), 'array'); $db = XoopsDatabaseFactory::getDatabaseConnection(); //Cache - $res_cache = $system->CleanCache($cache); + $res_cache = $system->CleanCache($cache); if (!empty($cache)) { for ($i = 0; $i < count($cache); $i++) { switch ($cache[$i]) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -23,11 +23,8 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} -$system = System::getInstance(); +$xoops = Xoops::getInstance(); + // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); @@ -59,7 +56,7 @@ if ($count == 0 && $op == 'list') { $form = $xoops->getModuleForm(null, 'maintenance'); $form->getDump(); - $form->render(); + $form->display(); } else { $admin_page->addItemButton(_AM_MAINTENANCE_DUMP_FORM, 'dump.php?op=dump', 'cd'); $admin_page->renderButton(); @@ -158,7 +155,7 @@ case 'dump': $form = $xoops->getModuleForm(null, 'maintenance'); $form->getDump(); - $form->render(); + $form->display(); break; } $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -22,10 +22,11 @@ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); $xoops->header(); $admin_page = new XoopsModuleAdmin(); -$admin_page->renderNavigation('index.php'); +$admin_page->displayNavigation('index.php'); // folder path $folder_path = XOOPS_ROOT_PATH . '/modules/maintenance/dump'; @@ -42,5 +43,5 @@ $admin_page->addConfigBoxLine(array($folder_path, '777'), 'chmod'); $admin_page->addInfoBox(_MI_MAINTENANCE_DUMP); $admin_page->addInfoBoxLine(sprintf(_AM_MAINTENANCE_NBFILES, $count)); -$admin_page->renderIndex(); +$admin_page->displayIndex(); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_center.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_center.html 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_center.html 2012-12-05 19:25:07 UTC (rev 10321) @@ -2,7 +2,7 @@ <{includeq file="admin:system|admin_tips.html"}> <{includeq file="admin:system|admin_buttons.html"}> <!-- Display form --> -<{includeq file="module:system|system_form.html"}> +<{$form}> <{if $smarty_cache || $smarty_compile || $xoops_cache || $session || $maintenance}> <div class="xo-moduleadmin-config outer"> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_dump.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_dump.html 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_dump.html 2012-12-05 19:25:07 UTC (rev 10321) @@ -2,7 +2,7 @@ <{includeq file="admin:system|admin_tips.html"}> <{includeq file="admin:system|admin_buttons.html"}> <!-- Display form --> -<{includeq file="module:system|system_form.html"}> +<{$form}> <{if $result_m}> <table class="outer tablesorter"> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/about.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/about.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/about.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -20,8 +20,9 @@ * @version $Id$ */ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); $xoops->header(); $aboutAdmin = new XoopsModuleAdmin(); -$aboutAdmin->renderNavigation('about.php'); -$aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', true); +$aboutAdmin->displayNavigation('about.php'); +$aboutAdmin->displayAbout('6KJ7RW5DR3VTJ', true); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/content.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/content.php 2012-12-05 19:21:45 UTC (rev 10320) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/content.php 2012-12-05 19:25:07 UTC (rev 10321) @@ -22,10 +22,7 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); // Parameters $nb_content = $xoops->getModuleConfig('page_adminpager'); // Get Action type @@ -91,8 +88,7 @@ $admin_page->renderButton(); $obj = $content_Handler->create(); $form = $xoops->getModuleForm($obj, 'page_content'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; case 'edit': @@ -102,8 +98,7 @@ // Create form $obj = $content_Handler->get($system->cleanVars($_REQUEST, 'id', 0, 'int')); $form = $xoops->getModuleForm($obj, 'page_content'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; case 'save': @@ -201,13 +196,13 @@ $perm_id = isset($_REQUEST['content_id']) ? $content_id : $newcontent_id; $criteria = new CriteriaCompo(); $criteria->add(new Criteria('gperm_itemid', $perm_id, '=')); - $criteria->add(new Criteria('gperm_modid', $xoopsModule->getVar('mid'),'=')); + $criteria->add(new Criteria('gperm_modid', $xoops->module->getVar('mid'),'=')); $criteria->add(new Criteria('gperm_name', 'page_view_item', '=')); $gperm_handler->deleteAll($criteria); //permissions view if(isset($_POST['groups_view_item'])) { foreach($_POST['groups_view_item'] as $onegroup_id) { - $gperm_handler->addRight('page_view_item', $perm_id, $onegroup_id, $xoopsModule->getVar('mid')); + $gperm_handler->addRight('page_view_item', $perm_id, $onegroup_id, $xoops->module->getVar('mid')); } } $xoops->redirect("content.php", 2, _AM_PAGE_DBUPDATED); @@ -215,8 +210,7 @@ $xoops->error($obj->getHtmlErrors()); } $form = $xoops->getModuleForm($obj, 'page_content'); - $form->render(); - $xoops->tpl->assign('form', true); + $xoops->tpl->assign('form', $form->render()); break; case 'delete': @@ -236,7 +230,7 @@ // deleting permissions $criteria = new CriteriaCompo(); $criteria->add(new Criteria('gperm_itemid', $content_id, '=')); - $criteria->add(new Criteria('gperm_modid', $xoopsModule->getVar('mid'),'=')); + $criteria->add(new Criteria('gperm_modid', $xoops->module->getVar('mid'),'=')); $criteria->add(new Criteria('gperm_name', 'page_view_item', '=')); $gperm_handler->deleteAll($criteria); // deleting secondary @@ -339,7 +333,7 @@ $gperm_handler = $xoops->getHandler('groupperm'); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('gperm_itemid', $content_id, '=')); - $criteria->add(new Criteria('gperm_modid', $xoopsModule->getVar('mid'),'=')); + $criteria->add(new Criteria('gperm_modid', $xoops->module->getVar('mid'),'=')); $criteria->add(new Criteria('gperm_name', 'page_view_item', '=')); $gperm_arr = $gperm_handler->getall($criteria); //permissions view Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/index.php =================================================================== --- XoopsCore/branches/... [truncated message content] |
From: <tr...@us...> - 2012-12-05 19:21:47
|
Revision: 10320 http://sourceforge.net/p/xoops/svn/10320 Author: trabis Date: 2012-12-05 19:21:45 +0000 (Wed, 05 Dec 2012) Log Message: ----------- XoopsThemeForm::render method should allways return content. While display should display it. I also changed xoopsModulesAdmin to follow this logic. It is important to be consistent. Several modules/templates were updated Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/admin/about.php XoopsModules/publisher/trunk/publisher/admin/index.php Modified: XoopsModules/publisher/trunk/publisher/admin/about.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/about.php 2012-12-05 19:14:00 UTC (rev 10319) +++ XoopsModules/publisher/trunk/publisher/admin/about.php 2012-12-05 19:21:45 UTC (rev 10320) @@ -27,6 +27,6 @@ $aboutAdmin = new ModuleAdmin(); echo $aboutAdmin->addNavigation('about.php'); -echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); +echo $aboutAdmin->displayAbout('6KJ7RW5DR3VTJ', false); xoops_cp_footer(); \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/index.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/index.php 2012-12-05 19:14:00 UTC (rev 10319) +++ XoopsModules/publisher/trunk/publisher/admin/index.php 2012-12-05 19:21:45 UTC (rev 10320) @@ -27,6 +27,6 @@ $indexAdmin = new ModuleAdmin(); echo $indexAdmin->addNavigation('index.php'); -echo $indexAdmin->renderIndex(); +echo $indexAdmin->displayIndex(); xoops_cp_footer(); \ No newline at end of file |
From: <tr...@us...> - 2012-12-05 19:14:03
|
Revision: 10319 http://sourceforge.net/p/xoops/svn/10319 Author: trabis Date: 2012-12-05 19:14:00 +0000 (Wed, 05 Dec 2012) Log Message: ----------- Allowing modules/preloads/etc to add their own classes using maps Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-04 20:08:57 UTC (rev 10318) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-05 19:14:00 UTC (rev 10319) @@ -25,6 +25,33 @@ class XoopsLoad { /** + * holds classes name and classes paths + * + * @var array + */ + static protected $map = array(); + + /** + * Allow modules/preloads/etc to add their own maps + * Use XoopsLoad::addMap(array('classname', 'path/to/class'); + * + * @param array $map + * + * @return array + */ + static function addMap(array $map) { + XoopsLoad::$map = array_merge(XoopsLoad::$map, $map); + return XoopsLoad::$map; + } + + /** + * @return array + */ + static function getMap() { + return XoopsLoad::$map; + } + + /** * @static * * @param string $name @@ -88,14 +115,10 @@ */ static private function loadCore($name) { - static $configs; - - if (!isset($configs)) { - $configs = XoopsLoad::loadCoreConfig(); - } - if (isset($configs[$name])) { + $map = XoopsLoad::addMap(XoopsLoad::loadCoreConfig()); + if (isset($map[$name])) { //attempt loading from map - require $configs[$name]; + require $map[$name]; if (class_exists($name) && method_exists($name, '__autoload')) { call_user_func(array($name, '__autoload')); } @@ -118,7 +141,7 @@ * * @static * @param string $name - * @return false|string + * @return bool|string */ static private function loadFramework($name) { |
From: <du...@us...> - 2012-12-04 20:09:00
|
Revision: 10318 http://sourceforge.net/p/xoops/svn/10318 Author: dugris Date: 2012-12-04 20:08:57 +0000 (Tue, 04 Dec 2012) Log Message: ----------- Fix groupby in criteria & model Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php 2012-12-03 23:33:54 UTC (rev 10317) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php 2012-12-04 20:08:57 UTC (rev 10318) @@ -161,16 +161,8 @@ */ public function getGroupby() { - return $this->groupby ? " GROUP BY {$this->groupby}" : ""; + return isset($this->groupby) ? $this->groupby : ""; } - - /** - * @return string - */ - public function getGroupbyField() - { - return $this->groupby ? $this->groupby : ""; - } } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php 2012-12-03 23:33:54 UTC (rev 10317) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php 2012-12-04 20:08:57 UTC (rev 10318) @@ -98,6 +98,9 @@ $sql .= " ORDER BY {$sort} " . $criteria->getOrder(); $orderSet = true; } + if ($criteria->getGroupby() != '') { + $sql .= ' GROUP BY (' . $criteria->getGroupby() . ')'; + } $limit = $criteria->getLimit(); $start = $criteria->getStart(); } @@ -139,6 +142,9 @@ $sql = " SELECT COUNT(DISTINCT {$this->handler->keyName}) AS count" . " FROM {$this->handler->table} AS o" . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; if (isset($criteria) && is_subclass_of($criteria, "criteriaelement")) { $sql .= " " . $criteria->renderWhere(); + if ($criteria->getGroupby() != '') { + $sql .= ' GROUP BY (' . $criteria->getGroupby() . ')'; + } } if (!$result = $this->handler->db->query($sql)) { return false; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php 2012-12-03 23:33:54 UTC (rev 10317) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php 2012-12-04 20:08:57 UTC (rev 10318) @@ -57,7 +57,7 @@ if (isset($criteria)) { $sql .= " " . $criteria->renderWhere(); if ($groupby = $criteria->getGroupby()) { - $sql .= $groupby; + $sql .= ' GROUP BY (' . $groupby . ')'; } if ($sort = $criteria->getSort()) { $sql .= " ORDER BY {$sort} " . $criteria->getOrder(); @@ -138,6 +138,9 @@ if ($sort = $criteria->getSort()) { $sql .= ' ORDER BY ' . $sort . ' ' . $criteria->getOrder(); } + if ($groupby = $criteria->getGroupby()) { + $sql .= ' GROUP BY (' . $groupby . ')'; + } $limit = $criteria->getLimit(); $start = $criteria->getStart(); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php 2012-12-03 23:33:54 UTC (rev 10317) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php 2012-12-04 20:08:57 UTC (rev 10318) @@ -44,15 +44,17 @@ $field = ''; $groupby = false; if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { - if ($criteria->getGroupbyField() != '') { + if ($criteria->getGroupby() != '') { $groupby = true; - $field = $criteria->getGroupbyField() . ", "; + $field = $criteria->getGroupby() . ", "; } } $sql = "SELECT {$field} COUNT(*) FROM `{$this->handler->table}`"; if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { $sql .= ' ' . $criteria->renderWhere(); - $sql .= $criteria->getGroupby(); + if ($criteria->getGroupby() != '') { + $sql .= ' GROUP BY (' . $criteria->getGroupby() . ')'; + } } $result = $this->handler->db->query($sql); if (!$result) { @@ -87,7 +89,7 @@ $sql_where = $criteria->renderWhere(); $limit = $criteria->getLimit(); $start = $criteria->getStart(); - if ($groupby = $criteria->getGroupbyField()) { + if ($groupby = $criteria->getGroupby()) { $groupby_key = $groupby; } } |
From: <du...@us...> - 2012-12-03 23:33:57
|
Revision: 10317 http://sourceforge.net/p/xoops/svn/10317 Author: dugris Date: 2012-12-03 23:33:54 +0000 (Mon, 03 Dec 2012) Log Message: ----------- replace XOOPS_TRUST_PATH with XOOPS_PATH Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-03 21:55:44 UTC (rev 10316) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-03 23:33:54 UTC (rev 10317) @@ -434,7 +434,7 @@ } $file = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; - if (!self::loadFile(XOOPS_TRUST_PATH . DIRECTORY_SEPARATOR . $file)) { + if (!self::loadFile(XOOPS_PATH . DIRECTORY_SEPARATOR . $file)) { return false; } |
From: <tr...@us...> - 2012-12-03 21:55:48
|
Revision: 10316 http://sourceforge.net/p/xoops/svn/10316 Author: trabis Date: 2012-12-03 21:55:44 +0000 (Mon, 03 Dec 2012) Log Message: ----------- Adding object dtypes to remove duplicate code in obejct and handler. It also allows to add new dtypes just by adding them to the folder. Perhaps in future we can allow developers to add their own dtypes without touching core. Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Registry.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Abstract.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Array.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Decimal.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Email.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Enum.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Float.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Int.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Ltime.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Mtime.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Other.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Source.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Stime.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Textarea.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Textbox.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Url.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/index.html Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/index.html Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php 2012-12-03 01:04:45 UTC (rev 10315) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -35,146 +35,28 @@ { /** * Clean values of all variables of the object for storage. - * also add slashes and quote string whereever needed + * also add slashes and quote string wherever needed * * CleanVars only contains changed and cleaned variables * Reference is used for PHP4 compliance * - * @param XoopsObject$object + * @param XoopsObject $object * * @return bool true if successful * @access public */ public function cleanVars(XoopsObject &$object) { - $ts = MyTextSanitizer::getInstance(); - $errors = array(); - $vars = $object->getVars(); $object->cleanVars = array(); foreach ($vars as $k => $v) { if (!$v["changed"]) { continue; } - $cleanv = $v['value']; - switch ($v["data_type"]) { - - case XOBJ_DTYPE_TXTBOX: - if ($v['required'] && $cleanv != '0' && $cleanv == '') { - $errors[] = sprintf(_XOBJ_ERR_REQUIRED, $k); - continue; - } - if (isset($v['maxlength']) && strlen($cleanv) > intval($v['maxlength'])) { - $errors[] = sprintf(_XOBJ_ERR_SHORTERTHAN, $k, intval($v['maxlength'])); - continue; - } - if (!$v['not_gpc']) { - $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv)); - } else { - $cleanv = $ts->censorString($cleanv); - } - $cleanv = str_replace('\\"', '"', $this->handler->db->quote($cleanv)); - break; - - case XOBJ_DTYPE_TXTAREA: - if ($v['required'] && $cleanv != '0' && $cleanv == '') { - $errors[] = sprintf(_XOBJ_ERR_REQUIRED, $k); - continue; - } - if (!$v['not_gpc']) { - if (!empty($vars['dohtml']['value'])) { - $cleanv = $ts->textFilter($cleanv); - } - $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv)); - } else { - $cleanv = $ts->censorString($cleanv); - } - $cleanv = str_replace('\\"', '"', $this->handler->db->quote($cleanv)); - break; - - case XOBJ_DTYPE_SOURCE: - $cleanv = trim($cleanv); - if (!$v['not_gpc']) { - $cleanv = $ts->stripSlashesGPC($cleanv); - } - $cleanv = str_replace('\\"', '"', $this->handler->db->quote($cleanv)); - break; - - case XOBJ_DTYPE_EMAIL: - $cleanv = trim($cleanv); - if ($v['required'] && $cleanv == '') { - $errors[] = sprintf(_XOBJ_ERR_REQUIRED, $k); - continue; - } - if ($cleanv != '' && !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i", $cleanv)) { - $errors[] = "Invalid Email"; - continue; - } - if (!$v['not_gpc']) { - $cleanv = $ts->stripSlashesGPC($cleanv); - } - $cleanv = str_replace('\\"', '"', $this->handler->db->quote($cleanv)); - break; - - case XOBJ_DTYPE_URL: - $cleanv = trim($cleanv); - if ($v['required'] && $cleanv == '') { - $errors[] = sprintf(_XOBJ_ERR_REQUIRED, $k); - continue; - } - if ($cleanv != '' && !preg_match("/^http[s]*:\/\//i", $cleanv)) { - $cleanv = 'http://' . $cleanv; - } - if (!$v['not_gpc']) { - $cleanv = $ts->stripSlashesGPC($cleanv); - } - $cleanv = str_replace('\\"', '"', $this->handler->db->quote($cleanv)); - break; - - case XOBJ_DTYPE_OTHER: - $cleanv = str_replace('\\"', '"', $this->handler->db->quote($cleanv)); - break; - - case XOBJ_DTYPE_INT: - $cleanv = intval($cleanv); - break; - - case XOBJ_DTYPE_FLOAT: - $cleanv = floatval($cleanv); - break; - - case XOBJ_DTYPE_DECIMAL: - $cleanv = doubleval($cleanv); - break; - - case XOBJ_DTYPE_ARRAY: - $cleanv = (array)$cleanv; - if (!$v['not_gpc']) { - $cleanv = array_map(array(&$ts, "stripSlashesGPC"), $cleanv); - } - foreach (array_keys($cleanv) as $key) { - $cleanv[$key] = str_replace('\\"', '"', addslashes($cleanv[$key])); - } - // TODO: Not encoding safe, should try base64_encode -- phppp - $cleanv = "'" . serialize($cleanv) . "'"; - break; - - case XOBJ_DTYPE_STIME: - case XOBJ_DTYPE_MTIME: - case XOBJ_DTYPE_LTIME: - $cleanv = !is_string($cleanv) ? intval($cleanv) : strtotime($cleanv); - break; - - default: - $cleanv = str_replace('\\"', '"', $this->handler->db->quote($cleanv)); - break; - } - $object->cleanVars[$k] = $cleanv; + $object->cleanVars[$k] = Xoops_Object_Dtype::cleanVar($object, $k); } - if (!empty($errors)) { - $object->setErrors($errors); - } $object->unsetDirty(); + $errors = $object->getErrors(); return empty($errors) ? true : false; } @@ -196,7 +78,7 @@ return $object->getVar($this->handler->keyName); } if (!$this->cleanVars($object)) { - trigger_error("Insert failed in method 'cleanVars' of object '" . get_class($object) . "'", E_USER_WARNING); + trigger_error("Insert failed in method 'cleanVars' of object '" . get_class($object) . "'" . $object->getHtmlErrors(), E_USER_WARNING); return $object->getVar($this->handler->keyName); } $queryFunc = empty($force) ? "query" : "queryF"; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2012-12-03 01:04:45 UTC (rev 10315) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -318,128 +318,7 @@ if (!isset($this->vars[$key])) { return $ret; } - $ret = $this->vars[$key]['value']; - $ts = MyTextSanitizer::getInstance(); - switch ($this->vars[$key]['data_type']) { - case XOBJ_DTYPE_TXTBOX: - switch (strtolower($format)) { - case 's': - case 'show': - case 'e': - case 'edit': - return $ts->htmlSpecialChars($ret); - break 1; - case 'p': - case 'preview': - case 'f': - case 'formpreview': - return $ts->htmlSpecialChars($ts->stripSlashesGPC($ret)); - break 1; - case 'n': - case 'none': - default: - break 1; - } - break; - case XOBJ_DTYPE_TXTAREA: - switch (strtolower($format)) { - case 's': - case 'show': - $html = !empty($this->vars['dohtml']['value']) ? 1 : 0; - $xcode = (!isset($this->vars['doxcode']['value']) || $this->vars['doxcode']['value'] == 1) ? 1 : 0; - $smiley = (!isset($this->vars['dosmiley']['value']) || $this->vars['dosmiley']['value'] == 1) ? 1 : 0; - $image = (!isset($this->vars['doimage']['value']) || $this->vars['doimage']['value'] == 1) ? 1 : 0; - $br = (!isset($this->vars['dobr']['value']) || $this->vars['dobr']['value'] == 1) ? 1 : 0; - return $ts->displayTarea($ret, $html, $smiley, $xcode, $image, $br); - break 1; - case 'e': - case 'edit': - return htmlspecialchars($ret, ENT_QUOTES); - break 1; - case 'p': - case 'preview': - $html = !empty($this->vars['dohtml']['value']) ? 1 : 0; - $xcode = (!isset($this->vars['doxcode']['value']) || $this->vars['doxcode']['value'] == 1) ? 1 : 0; - $smiley = (!isset($this->vars['dosmiley']['value']) || $this->vars['dosmiley']['value'] == 1) ? 1 : 0; - $image = (!isset($this->vars['doimage']['value']) || $this->vars['doimage']['value'] == 1) ? 1 : 0; - $br = (!isset($this->vars['dobr']['value']) || $this->vars['dobr']['value'] == 1) ? 1 : 0; - return $ts->previewTarea($ret, $html, $smiley, $xcode, $image, $br); - break 1; - case 'f': - case 'formpreview': - return htmlspecialchars($ts->stripSlashesGPC($ret), ENT_QUOTES); - break 1; - case 'n': - case 'none': - default: - break 1; - } - break; - case XOBJ_DTYPE_ARRAY: - switch (strtolower($format)) { - case 'n': - case 'none': - break 1; - default: - if (!is_array($ret)) { - if ($ret != '') { - $ret = unserialize($ret); - } - $ret = is_array($ret) ? $ret : array(); - } - return $ret; - break 1; - } - break; - case XOBJ_DTYPE_SOURCE: - switch (strtolower($format)) { - case 's': - case 'show': - break 1; - case 'e': - case 'edit': - return htmlspecialchars($ret, ENT_QUOTES); - break 1; - case 'p': - case 'preview': - return $ts->stripSlashesGPC($ret); - break 1; - case 'f': - case 'formpreview': - return htmlspecialchars($ts->stripSlashesGPC($ret), ENT_QUOTES); - break 1; - case 'n': - case 'none': - default: - break 1; - } - break; - default: - if ($this->vars[$key]['options'] != '' && $ret != '') { - switch (strtolower($format)) { - case 's': - case 'show': - $selected = explode('|', $ret); - $options = explode('|', $this->vars[$key]['options']); - $i = 1; - $ret = array(); - foreach ($options as $op) { - if (in_array($i, $selected)) { - $ret[] = $op; - } - $i++; - } - return implode(', ', $ret); - case 'e': - case 'edit': - $ret = explode('|', $ret); - break 1; - default: - break 1; - } - } - break; - } + $ret = Xoops_Object_Dtype::getVar($this, $key, $format); return $ret; } @@ -456,98 +335,10 @@ $existing_errors = $this->getErrors(); $this->_errors = array(); foreach ($this->vars as $k => $v) { - $cleanv = $v['value']; if (!$v['changed']) { } else { - $cleanv = is_string($cleanv) ? trim($cleanv) : $cleanv; - switch ($v['data_type']) { - case XOBJ_DTYPE_TXTBOX: - if ($v['required'] && $cleanv != '0' && $cleanv == '') { - $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); - continue; - } - if (isset($v['maxlength']) && strlen($cleanv) > intval($v['maxlength'])) { - $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, intval($v['maxlength']))); - continue; - } - if (!$v['not_gpc']) { - $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv)); - } else { - $cleanv = $ts->censorString($cleanv); - } - break; - case XOBJ_DTYPE_TXTAREA: - if ($v['required'] && $cleanv != '0' && $cleanv == '') { - $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); - continue; - } - if (!$v['not_gpc']) { - $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv)); - } else { - $cleanv = $ts->censorString($cleanv); - } - break; - case XOBJ_DTYPE_SOURCE: - if (!$v['not_gpc']) { - $cleanv = $ts->stripSlashesGPC($cleanv); - } - break; - case XOBJ_DTYPE_INT: - $cleanv = intval($cleanv); - break; - - case XOBJ_DTYPE_EMAIL: - if ($v['required'] && $cleanv == '') { - $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); - continue; - } - if ($cleanv != '' && !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i", $cleanv)) { - $this->setErrors("Invalid Email"); - continue; - } - if (!$v['not_gpc']) { - $cleanv = $ts->stripSlashesGPC($cleanv); - } - break; - case XOBJ_DTYPE_URL: - if ($v['required'] && $cleanv == '') { - $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); - continue; - } - if ($cleanv != '' && !preg_match("/^http[s]*:\/\//i", $cleanv)) { - $cleanv = 'http://' . $cleanv; - } - if (!$v['not_gpc']) { - $cleanv = $ts->stripSlashesGPC($cleanv); - } - break; - case XOBJ_DTYPE_ARRAY: - $cleanv = (array)$cleanv; - $cleanv = serialize($cleanv); - break; - case XOBJ_DTYPE_STIME: - case XOBJ_DTYPE_MTIME: - case XOBJ_DTYPE_LTIME: - $cleanv = !is_string($cleanv) ? intval($cleanv) : strtotime($cleanv); - break; - case XOBJ_DTYPE_FLOAT: - $cleanv = floatval($cleanv); - break; - case XOBJ_DTYPE_DECIMAL: - $cleanv = doubleval($cleanv); - break; - case XOBJ_DTYPE_ENUM: - if (!in_array($cleanv, $v['enumeration'])) { - $this->setErrors("Invalid Enumeration"); - continue; - } - break; - default: - break; - } + $this->cleanVars[$k] = Xoops_Object_Dtype::cleanVar($this, $k); } - $this->cleanVars[$k] = str_replace('\\"', '"', $cleanv); - unset($cleanv); } if (count($this->_errors) > 0) { $this->_errors = array_merge($existing_errors, $this->_errors); @@ -616,10 +407,11 @@ $module_handler = $xoops->getHandlerModule(); $modules_obj = $module_handler->getObjectsArray(new Criteria('isactive', 1)); $modules_active = array(); - foreach (array_keys($modules_obj) as $key) { - $modules_active[] = $modules_obj[$key]->getVar('dirname'); + /* @var XoopsModule $module_obj */ + foreach ($modules_obj as $module_obj) { + $modules_active[] = $module_obj->getVar('dirname'); } - unset($modules_obj); + unset($modules_obj, $module_obj); Xoops_Cache::write('system_modules_active', $modules_active); } foreach ($modules_active as $dirname) { @@ -707,7 +499,7 @@ /** * XOOPS object handler class. * This class is an abstract class of handler classes that are responsible for providing - * data access mechanisms to the data source of its corresponsing data objects + * data access mechanisms to the data source of its corresponding data objects * * @package kernel * @abstract @@ -908,7 +700,7 @@ * @access protected * @param string $name handler name * @param mixed $args args - * @return object of handler {@link XoopsObjectAbstract} + * @return object of handler {@link XoopsModelAbstract} */ public function loadHandler($name, $args = null) { @@ -916,11 +708,14 @@ if (!isset($handlers[$name])) { $xmf = XoopsModelFactory::getInstance(); $handlers[$name] = $xmf->loadHandler($this, $name, $args); + $handler = $handlers[$name]; } else { - $handlers[$name]->setHandler($this); - $handlers[$name]->setVars($args); + /* @var $handler XoopsModelAbstract */ + $handler = $handlers[$name]; + $handler->setHandler($this); + $handler->setVars($args); } - return $handlers[$name]; + return $handler; /** * // Following code just kept as placeholder for PHP5 Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/index.html 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/index.html 2012-12-03 01:04:45 UTC (rev 10315) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/index.html 2012-12-03 21:55:44 UTC (rev 10316) @@ -1 +0,0 @@ - <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/index.html 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php 2012-12-03 01:04:45 UTC (rev 10315) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -10,10 +10,12 @@ */ /** - * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ + * Debug + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @package class - * @since 2.6 + * @since 2.6.0 * @author trabis <lus...@gm...> * @version $Id$ */ Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Abstract.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Abstract.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Abstract.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,90 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +abstract class Xoops_Object_Dtype_Abstract +{ + /** + * @var XoopsDatabase + */ + protected $db; + + /** + * @var MytextSanitizer + */ + protected $ts; + + /** + * Sets database and sanitizer for easy access + */ + public function init() + { + $this->db = XoopsDatabaseFactory::getDatabaseConnection(); + $this->ts = MyTextSanitizer::getInstance(); + } + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return mixed + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + $value = str_replace('\\"', '"', $this->db->quote($value)); + return $value; + } + + /** + * @param XoopsObject $obj + * @param string $key + * @param string $format + * + * @return mixed + */ + public function getVar(XoopsObject $obj, $key, $format) + { + $value = $obj->vars[$key]['value']; + if ($obj->vars[$key]['options'] != '' && $value != '') { + switch (strtolower($format)) { + case 's': + case 'show': + $selected = explode('|', $value); + $options = explode('|', $obj->vars[$key]['options']); + $i = 1; + $ret = array(); + foreach ($options as $op) { + if (in_array($i, $selected)) { + $ret[] = $op; + } + $i++; + } + return implode(', ', $ret); + case 'e': + case 'edit': + return explode('|', $value); + default: + } + } + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Abstract.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/xoops_lib/Xoops/Object/Dtype/Array.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Array.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Array.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,70 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Array extends Xoops_Object_Dtype_Abstract +{ + /** + * @param XoopsObject $obj + * @param string $key + * @param string $format + * + * @return array|mixed + */ + public function getVar(XoopsObject $obj, $key, $format) + { + $value = $obj->vars[$key]['value']; + switch (strtolower($format)) { + case 'n': + case 'none': + return $value; + default: + if (!is_array($value)) { + if ($value != '') { + $value = unserialize($value); + } + $value = is_array($value) ? $value : array(); + } + return $value; + } + } + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + $value = (array)$value; + if (!$obj->vars[$key]['not_gpc']) { + $value = array_map(array(&$this->ts, "stripSlashesGPC"), $value); + } + foreach (array_keys($value) as $key) { + $value[$key] = str_replace('\\"', '"', addslashes($value[$key])); + } + // TODO: Not encoding safe, should try base64_encode -- phppp + $value = "'" . serialize($value) . "'"; + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Array.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/xoops_lib/Xoops/Object/Dtype/Decimal.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Decimal.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Decimal.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,38 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Decimal extends Xoops_Object_Dtype_Abstract +{ + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + $value = doubleval($value); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Decimal.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/xoops_lib/Xoops/Object/Dtype/Email.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Email.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Email.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,49 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Email extends Xoops_Object_Dtype_Abstract +{ + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = trim($obj->vars[$key]['value']); + + if ($obj->vars[$key]['required'] && $value == '') { + $obj->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $key)); + return $value; + } + if ($value != '' && !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i", $value)) { + $obj->setErrors("Invalid Email"); + return $value; + } + if (!$obj->vars[$key]['not_gpc']) { + $value = $this->ts->stripSlashesGPC($value); + } + $value = str_replace('\\"', '"', $this->db->quote($value)); + return $value; + } +} Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Email.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/xoops_lib/Xoops/Object/Dtype/Enum.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Enum.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Enum.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,41 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Enumeration extends Xoops_Object_Dtype_Abstract +{ + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + if (!in_array($value, $obj->vars[$key]['enumeration'])) { + $obj->setErrors("Invalid Enumeration"); + return $value; + } + $value = str_replace('\\"', '"', $this->db->quote($value)); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Enum.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/xoops_lib/Xoops/Object/Dtype/Float.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Float.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Float.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,38 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Float extends Xoops_Object_Dtype_Abstract +{ + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + $value = floatval($value); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Float.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/xoops_lib/Xoops/Object/Dtype/Int.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Int.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Int.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,65 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Int extends Xoops_Object_Dtype_Abstract +{ + /** + * @param XoopsObject $obj + * @param string $key + * @param string $format + * + * @return string + */ + public function getVar(XoopsObject $obj, $key, $format) + { + $value = $obj->vars[$key]['value']; + switch (strtolower($format)) { + case 's': + case 'show': + case 'e': + case 'edit': + return $this->ts->htmlSpecialChars($value); + case 'p': + case 'preview': + case 'f': + case 'formpreview': + return $this->ts->htmlSpecialChars($this->ts->stripSlashesGPC($value)); + case 'n': + case 'none': + default: + return $value; + } + } + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + $value = intval($value); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Int.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/xoops_lib/Xoops/Object/Dtype/Ltime.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Ltime.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Ltime.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,38 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Ltime extends Xoops_Object_Dtype_Abstract +{ + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + $value = !is_string($value) ? intval($value) : strtotime($value); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Ltime.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/xoops_lib/Xoops/Object/Dtype/Mtime.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Mtime.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Mtime.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,38 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Mtime extends Xoops_Object_Dtype_Abstract +{ + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + $value = !is_string($value) ? intval($value) : strtotime($value); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Mtime.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/xoops_lib/Xoops/Object/Dtype/Other.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Other.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Other.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,25 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Other extends Xoops_Object_Dtype_Abstract +{ +} Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Other.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/xoops_lib/Xoops/Object/Dtype/Source.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Source.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Source.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,71 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Source extends Xoops_Object_Dtype_Abstract +{ + /** + * @param XoopsObject $obj + * @param string $key + * @param string $format + * + * @return string + */ + public function getVar(XoopsObject $obj, $key, $format) + { + $value = $obj->vars[$key]['value']; + switch (strtolower($format)) { + case 's': + case 'show': + return $value; + case 'e': + case 'edit': + return htmlspecialchars($value, ENT_QUOTES); + case 'p': + case 'preview': + return $this->ts->stripSlashesGPC($value); + case 'f': + case 'formpreview': + return htmlspecialchars($this->ts->stripSlashesGPC($value), ENT_QUOTES); + case 'n': + case 'none': + default: + return $value; + } + } + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = trim($obj->vars[$key]['value']); + + if (!$obj->vars[$key]['not_gpc']) { + $value = $this->ts->stripSlashesGPC($value); + } + $value = str_replace('\\"', '"', $this->db->quote($value)); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Source.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/xoops_lib/Xoops/Object/Dtype/Stime.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Stime.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Stime.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,38 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Stime extends Xoops_Object_Dtype_Abstract +{ + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + $value = !is_string($value) ? intval($value) : strtotime($value); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Stime.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/xoops_lib/Xoops/Object/Dtype/Textarea.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Textarea.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Textarea.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,87 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Textarea extends Xoops_Object_Dtype_Abstract +{ + /** + * @param XoopsObject $obj + * @param string $key + * @param string $format + * + * @return mixed|string + */ + public function getVar(XoopsObject $obj, $key, $format) + { + $value = $obj->vars[$key]['value']; + switch (strtolower($format)) { + case 's': + case 'show': + $html = !empty($obj->vars['dohtml']['value']) ? 1 : 0; + $xcode = (!isset($obj->vars['doxcode']['value']) || $obj->vars['doxcode']['value'] == 1) ? 1 : 0; + $smiley = (!isset($obj->vars['dosmiley']['value']) || $obj->vars['dosmiley']['value'] == 1) ? 1 : 0; + $image = (!isset($obj->vars['doimage']['value']) || $obj->vars['doimage']['value'] == 1) ? 1 : 0; + $br = (!isset($obj->vars['dobr']['value']) || $obj->vars['dobr']['value'] == 1) ? 1 : 0; + return $this->ts->displayTarea($value, $html, $smiley, $xcode, $image, $br); + + case 'e': + case 'edit': + return htmlspecialchars($value, ENT_QUOTES); + case 'p': + case 'preview': + $html = !empty($obj->vars['dohtml']['value']) ? 1 : 0; + $xcode = (!isset($obj->vars['doxcode']['value']) || $obj->vars['doxcode']['value'] == 1) ? 1 : 0; + $smiley = (!isset($obj->vars['dosmiley']['value']) || $obj->vars['dosmiley']['value'] == 1) ? 1 : 0; + $image = (!isset($obj->vars['doimage']['value']) || $obj->vars['doimage']['value'] == 1) ? 1 : 0; + $br = (!isset($obj->vars['dobr']['value']) || $obj->vars['dobr']['value'] == 1) ? 1 : 0; + return $this->ts->previewTarea($value, $html, $smiley, $xcode, $image, $br); + case 'f': + case 'formpreview': + return htmlspecialchars($this->ts->stripSlashesGPC($value), ENT_QUOTES); + case 'n': + case 'none': + default: + return $value; + } + } + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string|void + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + if ($obj->vars[$key]['required'] && $value != '0' && $value == '') { + $obj->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $key)); + return $value; + } + if (!$obj->vars[$key]['not_gpc']) { + $value = $this->ts->stripSlashesGPC($this->ts->censorString($value)); + } else { + $value = $this->ts->censorString($value); + } + $value = str_replace('\\"', '"', $this->db->quote($value)); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Textarea.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/xoops_lib/Xoops/Object/Dtype/Textbox.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Textbox.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Textbox.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,78 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Textbox extends Xoops_Object_Dtype_Abstract +{ + /** + * @param XoopsObject $obj + * @param string $key + * @param string $format + * + * @return string + */ + public function getVar(XoopsObject $obj, $key, $format) + { + $value = $obj->vars[$key]['value']; + switch (strtolower($format)) { + case 's': + case 'show': + case 'e': + case 'edit': + return $this->ts->htmlSpecialChars($value); + case 'p': + case 'preview': + case 'f': + case 'formpreview': + return $this->ts->htmlSpecialChars($this->ts->stripSlashesGPC($value)); + case 'n': + case 'none': + default: + return $value; + } + } + + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = $obj->vars[$key]['value']; + if ($obj->vars[$key]['required'] && $value != '0' && $value == '') { + $obj->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $key)); + return $value; + } + if (isset($obj->vars[$key]['maxlength']) && strlen($value) > intval($obj->vars[$key]['maxlength'])) { + $obj->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $key, intval($obj->vars[$key]['maxlength']))); + return $value; + } + if (!$obj->vars[$key]['not_gpc']) { + $value = $this->ts->stripSlashesGPC($this->ts->censorString($value)); + } else { + $value = $this->ts->censorString($value); + } + $value = str_replace('\\"', '"', $this->db->quote($value)); + return $value; + } +} Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Textbox.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/xoops_lib/Xoops/Object/Dtype/Url.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Url.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Object/Dtype/Url.php 2012-12-03 21:55:44 UTC (rev 10316) @@ -0,0 +1,47 @@ +<?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 + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Object_Dtype_Url extends Xoops_Object_Dtype_Abstract +{ + /** + * @param XoopsObject $obj + * @param string $key + * + * @return string + */ + public function cleanVar(XoopsObject $obj, $key) + { + $value = trim($obj->vars[$key]['value']); + if ($obj->vars[$key]['required'] && $value == '') { + $obj->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $key)); + return $value; + } + if ($value != '' && !preg_match("/^http[s]*:\/\//i", $value)) { + $value = 'http://' . $value; + } + if (!$obj->vars[$key]['not_gpc']) { + $value = $this->ts->stripSlashesGPC($value); + } + $value = str_replace('\\"', '"', $this->db->quote($value)); + return $value; + } +} \ No newline at end of file Property changes on: XoopsCore/branc... [truncated message content] |
From: <du...@us...> - 2012-12-03 01:04:47
|
Revision: 10315 http://sourceforge.net/p/xoops/svn/10315 Author: dugris Date: 2012-12-03 01:04:45 +0000 (Mon, 03 Dec 2012) Log Message: ----------- Fix CSS Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/help.css Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/help.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/help.css 2012-12-03 00:50:18 UTC (rev 10314) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/help.css 2012-12-03 01:04:45 UTC (rev 10315) @@ -16,7 +16,7 @@ } .help-item { margin-bottom: 20px; - display: blockj; + display: block; } .help-title { width: 80%; |
From: <du...@us...> - 2012-12-03 00:50:21
|
Revision: 10314 http://sourceforge.net/p/xoops/svn/10314 Author: dugris Date: 2012-12-03 00:50:18 +0000 (Mon, 03 Dec 2012) Log Message: ----------- fix notice error Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/File.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/File.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/File.php 2012-12-03 00:25:57 UTC (rev 10313) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/File.php 2012-12-03 00:50:18 UTC (rev 10314) @@ -90,7 +90,7 @@ $settings += array( 'engine' => 'File', 'path' => XOOPS_VAR_PATH . '/caches/xoops_cache', 'extension' => '.php', 'lock' => false, 'serialize' => false, 'duration' => 31556926, - 'mask' => 0664 + 'mask' => 0664, 'isWindows' => false ); parent::init($settings); |
From: <tr...@us...> - 2012-12-03 00:25:59
|
Revision: 10313 http://sourceforge.net/p/xoops/svn/10313 Author: trabis Date: 2012-12-03 00:25:57 +0000 (Mon, 03 Dec 2012) Log Message: ----------- Removing not needed events and removing cache for front page Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php 2012-12-03 00:04:03 UTC (rev 10312) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php 2012-12-03 00:25:57 UTC (rev 10313) @@ -40,12 +40,9 @@ /** * @param array $args */ - static public function eventCoreHeaderEnd($args) + static public function eventCoreHeaderCheckcache($args) { $xoops = Xoops::getInstance(); - include_once dirname(dirname(__FILE__)) . '/api.php'; - include_once dirname(dirname(__FILE__)) . '/include/vars.php'; - include_once dirname(dirname(__FILE__)) . '/include/functions.php'; xlanguage_select_show(explode('|', $xoops->registry->get('XLANGUAGE_THEME_OPTIONS'))); } } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php 2012-12-03 00:04:03 UTC (rev 10312) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php 2012-12-03 00:25:57 UTC (rev 10313) @@ -399,9 +399,6 @@ // for legacy support when template is set after header. $this->option['template_main'] = $this->tpl_name; - // Load xlanguage api - $this->preload->triggerEvent('core.language.common'); - $xoopsThemeFactory = null; $xoopsThemeFactory = new XoopsThemeFactory(); $xoopsThemeFactory->allowedThemes = $this->getConfig('theme_set_allowed'); @@ -411,9 +408,6 @@ $this->preload->triggerEvent('core.header.addmeta'); - // common preload : xlanguage block, ... - $this->preload->triggerEvent('core.header.common'); - // Temporary solution for start page redirection if (defined("XOOPS_STARTPAGE_REDIRECTED")) { $this->theme->headContent(null, "<base href='" . XOOPS_URL . '/modules/' . $this->getConfig('startpage') . "/' />", null, null); @@ -439,7 +433,7 @@ // Tricky solution for setting cache time for homepage } else { if ($this->tpl_name == 'module:system|system_homepage.html') { - $this->theme->contentCacheLifetime = 604800; + // $this->theme->contentCacheLifetime = 604800; } } |
From: <tr...@us...> - 2012-12-03 00:04:05
|
Revision: 10312 http://sourceforge.net/p/xoops/svn/10312 Author: trabis Date: 2012-12-03 00:04:03 +0000 (Mon, 03 Dec 2012) Log Message: ----------- Uploading a cache usage example. Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/cache.php Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/cache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/cache.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/cache.php 2012-12-03 00:04:03 UTC (rev 10312) @@ -0,0 +1,55 @@ +<?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(__FILE__)) . DIRECTORY_SEPARATOR . 'mainfile.php'; + +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 |
From: <du...@us...> - 2012-12-02 23:45:53
|
Revision: 10311 http://sourceforge.net/p/xoops/svn/10311 Author: dugris Date: 2012-12-02 23:45:50 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Add two form type : <input type='mail' .....> <input type='url' .....> Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-02 23:36:20 UTC (rev 10310) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-02 23:45:50 UTC (rev 10311) @@ -298,6 +298,8 @@ 'xoopsformtext' => XOOPS_ROOT_PATH . '/class/xoopsform/formtext.php', 'xoopsformtextarea' => XOOPS_ROOT_PATH . '/class/xoopsform/formtextarea.php', 'xoopsformtextdateselect' => XOOPS_ROOT_PATH . '/class/xoopsform/formtextdateselect.php', + 'xoopsformmail' => XOOPS_ROOT_PATH . '/class/xoopsform/formmail.php', + 'xoopsformurl' => XOOPS_ROOT_PATH . '/class/xoopsform/formurl.php', 'xoopsgroupformcheckbox' => XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php', 'xoopsgrouppermform' => XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php', 'xoopsguestuser' => XOOPS_ROOT_PATH . '/kernel/user.php', |
From: <tr...@us...> - 2012-12-02 23:36:26
|
Revision: 10310 http://sourceforge.net/p/xoops/svn/10310 Author: trabis Date: 2012-12-02 23:36:20 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Adding html2pdf for testing. Xoops_Pdf class added. See example on examples examples/pdf.php Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/ XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/pdf.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Pdf.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_LGPL.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_changelog.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/exception.class.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/locale.class.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/myPdf.class.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/parsingCss.class.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/parsingHtml.class.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/tcpdfConfig.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_lisez_moi.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_read_me.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/2dbarcodes.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/CHANGELOG.TXT XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/LICENSE.TXT XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/README.TXT XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/barcodes.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/cache/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/cache/chapter_demo_1.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/cache/chapter_demo_2.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/cache/table_data_demo.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/cache/utf8test.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/config/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/config/lang/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/config/lang/bra.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/config/lang/eng.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/config/lang/ger.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/config/lang/ita.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/config/tcpdf_config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/config/tcpdf_config_alt.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/doc/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/doc/read_me.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/examples/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/examples/read_me.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/README.TXT XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/ZarBold.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/ZarBold.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/almohanad.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/almohanad.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/almohanad.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/arialunicid0.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/courier.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/AUTHORS XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/BUGS XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/LICENSE XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/NEWS XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/README XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/langcover.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/status.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/unicover.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusans.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusans.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusans.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansb.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansb.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansb.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansbi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansbi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansbi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensed.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensed.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensed.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedb.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedb.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedb.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedbi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedbi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedbi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmono.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmono.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmono.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonob.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonob.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonob.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonobi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonobi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonobi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonoi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonoi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonoi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserif.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserif.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserif.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifb.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifb.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifb.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifbi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifbi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifbi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensed.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensed.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensed.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedb.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedb.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedb.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedbi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedbi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedbi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/AUTHORS XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/COPYING XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/CREDITS XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/ChangeLog XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/INSTALL XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/README XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemono.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemono.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemono.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemonob.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemonob.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemonob.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemonobi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemonobi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemonobi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemonoi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemonoi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freemonoi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesans.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesans.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesans.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesansb.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesansb.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesansb.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesansbi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesansbi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesansbi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesansi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesansi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freesansi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserif.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserif.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserif.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifb.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifb.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifb.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifbi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifbi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifbi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifi.ctg.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifi.z XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/helvetica.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/helveticab.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/helveticabi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/helveticai.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/hysmyeongjostdmedium.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/kozgopromedium.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/kozminproregular.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/msungstdlight.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/stsongstdlight.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/symbol.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/times.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/timesb.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/timesbi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/timesi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/uni2cid_ac15.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/uni2cid_ag15.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/uni2cid_aj16.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/uni2cid_ak12.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/README.TXT XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1250.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1251.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1252.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1253.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1254.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1255.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1257.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1258.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp874.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-1.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-11.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-15.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-16.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-2.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-4.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-5.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-7.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-9.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/koi8-r.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/koi8-u.map XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/freetype6.dll XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/makeallttffonts.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/makefont.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/pfm2afm XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/pfm2afm.exe XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/src/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/src/pfm2afm-src.tar.gz XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/src/readme.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/src/ttf2ufm-src.tar.gz XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/ttf2ufm XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/ttf2ufm.exe XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/utils/zlib1.dll XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/zapfdingbats.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/fonts/zarbold.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/htmlcolors.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/images/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/images/read_me.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/qrcode.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/tcpdf.crt XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/tcpdf.fdf XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/tcpdf.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/unicode_data.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/bookmark.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple00.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple01.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple02.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple03.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple04.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple05.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple06.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple07.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple08.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple09.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple10.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple11.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple12.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple13.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/forms.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/groups.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/js1.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/js2.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/js3.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/qrcode.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/radius.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/regle.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/bas_page.png XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple00.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple01.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple02.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple03.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple04.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple05.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple06.css XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple06.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple07a.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple07b.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple08.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple09.png.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple10.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple10a.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple10b.jpg XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple10c.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple11.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple12.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/exemple13.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/forms.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/logo.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/logo.png XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/off.png XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/puce.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/puce2.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/regle.png XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/svg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/res/tcpdf_logo.jpg XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/svg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/svg_tiger.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/svg_tree.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/ticket.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/utf8.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/html2pdf.class.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/ca.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/cs.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/da.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/de.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/en.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/es.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/fr.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/it.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/nl.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/pt.csv XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/locale/tr.csv Modified: XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt 2012-12-02 21:34:50 UTC (rev 10309) +++ XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt 2012-12-02 23:36:20 UTC (rev 10310) @@ -6,6 +6,7 @@ Updating cache engines (trabis) Adding Xoops_Highlighter class (trabis) Adding Xoops_Debug class (trabis) +Adding Xoops_Pdf class and htm2pdf (trabis) =============================== 2012/08: Version 2.6.0 Alpha 1 Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/pdf.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/pdf.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/pdf.php 2012-12-02 23:36:20 UTC (rev 10310) @@ -0,0 +1,31 @@ +<?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(__FILE__)) . DIRECTORY_SEPARATOR . 'mainfile.php'; + +$xoops = Xoops::getInstance(); +$content = Xoops_Debug::dump($xoops->getConfigs(), false); + +$tpl = new XoopsTpl(); +$tpl->assign('dummy_content' , $content); +$content2 = $tpl->fetch('module:system|system_dummy.html'); + +$pdf = new Xoops_Pdf(); +$pdf->writeHtml($content2, false); +$pdf->Output('example.pdf'); + Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/pdf.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Pdf.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Pdf.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Pdf.php 2012-12-02 23:36:20 UTC (rev 10310) @@ -0,0 +1,59 @@ +<?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. +*/ + +/** + * Pdf + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +include_once dirname(dirname(__FILE__)) . '/html2pdf/html2pdf.class.php'; + +class Xoops_Pdf extends HTML2PDF +{ + /** + * class constructor + * + * @access public + * + * @param string $orientation page orientation, same as TCPDF + * @param mixed $format The format used for pages, same as TCPDF + * @param string $langue Langue : fr, en, it... + * @param boolean $unicode TRUE means that the input text is unicode (default = true) + * @param string $encoding charset encoding; default is UTF-8 + * @param array $marges Default marges (left, top, right, bottom) + */ + public function __construct($orientation = 'P', $format = 'A4', $langue = _LANGCODE, $unicode = true, $encoding = _CHARSET, $marges = array( + 5, 5, 5, 8 + )) + { + $xoops = Xoops::getInstance(); + error_reporting(0); + $xoops->logger->activated = false; + + parent::__construct($orientation, $format, $langue, $unicode, $encoding, $marges = array(5, 5, 5, 8)); + } + + /** + * Destructor + */ + public function __destruct() + { + parent::__destruct(); + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Pdf.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_LGPL.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_LGPL.txt (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_LGPL.txt 2012-12-02 23:36:20 UTC (rev 10310) @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_changelog.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_changelog.txt (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_changelog.txt 2012-12-02 23:36:20 UTC (rev 10310) @@ -0,0 +1,314 @@ +4.03 (2011-05-27) + correction de l'exemple "form.php" : vulnérabilité cross-site scripting corrigée + correction sur la gestion des retours à la ligne automatique + correction sur le calcul de la hauteur des balises H1->H6 + amélioration de la gestion des exceptions + +4.02 (2011-04-29) + ATTENTION : beaucoup de changements dans la structure du projet. version 3.xx abandonnée + uniformisation des fichiers du projet (standard Zend) + conversion des fichiers de langue en CSV, déplacement dans le répertoire "locale". création d'une classe spécifique à la gestion des locales + amélioration de la gestion de certaines erreurs + modification du nom de toutes les sous classes + déplacement de toutes les sous classes + modification du nom de toutes les méthodes protected + correction sur la gestion des tables + correction sur la lecture des path des SVG + premiere version de text-align:justify + correction sur la gestion de la balise BLOCKQUOTE + correction sur la gestion de la balise P + gestion des styles CSS pour les balises TEXTAREA, SELECT, INPUT + ajout de la propriété pagegroup="new" sur la balise PAGE + correction pour la balise INPUT de type radio : checked au lieu de selected + +3.30 / 4.01 (2010-05-07) + correction sur la gestion des textes + correction sur le parseur HTML + correction sur la gestion de border-collapse + correction sur la gestion des TDs, H1->H6 + ajout des balises fieldset et legend (cf exemple 4) + ajout de la langue CS + nombreuses améliorations + v4.01 uniquement : Utilisation de TCPDF 5.0.002 + v4.01 uniquement : Utilisation des QR-code de TCPDF, il n'y a plus besoin d'une librairie externe + v4.01 uniquement : Utilisation des exceptions PHP pour les erreurs. Tous les exemples ont été mis à jour en consequence + (merci à Pavel Kochman pour ses sugestions et ses ajouts) + +3.29 / 4.00 (2010-03-17) + modification des barcodes. ATTENTION : bar_w et bar_h n'existent plus ! + correction sur la gestion de page_footer + correction sur la gestion des html entities + correction sur le positionnement des textes + correction sur le positionnement des tableaux + nombreuses corrections sur les positionnements, les couleurs, ... + amélioration de la partie SVG (balise G, ...) + amélioration sur createIndex + harmonisation des noms des méthodes + correction sur la gestion des textes + v4.00 uniquement : HTML2PDF est maintenant écrit en PHP5 et basé sur TCPDF (=> unicode, utf8, ...) + v4.00 uniquement : utilisation de TCPDF pour les formulaires et les barcodes + v4.00 uniquement : amélioration de la partie SVG (alpha) + +3.28 (2010-01-18) + ajout de la gestion de la balise label + correction pour compatibilité PHP4 + +3.27 (2010-01-11) + correction sur page_header et page_footer + ajout de la possibilité de pouvoir mettre l'index automatique dans la page que l'on veut + correction sur la gestion du canal alpha pour les PNGs + correction sur la gestion des border-radius (cf exemple radius) conforme au CSS3 + correction sur la gestion du background-color + correction sur la gestion de thead, tfoot, et tbody + ajout du dessin verctoriel (cf exemples draw, tigre, sapin) + ajout de la propriété label="none/label" pour la balise <barcode> + nombreux petits correctifs + +3.26 (2009-11-16) + correction pour support des images générés en CGI + ajout de la gestion du canal alpha pour les PNGs (nécessite GD2) + ajout de la méthode setDefaultFont permettant de spécifier une fonte par défaut + ajout de la propriété format pour la balise <page> (cf exemple 4) + amélioration de la gestion des couleurs css RGB (cf exemple 2) + ajout de la gestion des couleurs css CMYK (cf exemple 2) + ajout de la propriété css overflow:hidden pour la balise <div> (cf exemple 2) + correction sur page_header et page_footer + ajout de la possibilité de pouvoir directement convertir le résultat d'une vraie page HTML + nombreux petits correctifs sur les styles + +3.25 (2009-10-07) + correctif sur le calcul des tableaux dans le page_footer + correctif sur l'interprétation des espaces entre certaines balises + correction sur la gestion des balises H1, H2, H3, H4, H5, H6 + correction sur la gestion de la balise table + support des balises xhtml du type <span /> + ajout des balises COL (cf exemple 5), DEL, INS, et QRCODE (cf exemple 13) + ajout de la propriété css text-transform + ajout de la propriété css rotate (uniquement sur les DIV, cf exemple 8) + ne plus rendre obligatoire l'existence d'une image (nouvelle méthode setTestIsImage) + ajout d'un mode DEBUG - les anciennes fonction d'analyse des ressources ont été supprimées + ajout de la méthode setEncoding + ajout de la langue danoise DA (merci à Daniel K.) + +3.24 (2009-08-05) + correction sur le calcul de la largeur des divs + modification pour compatibilité avec la localisation PHP + modification pour compatibilité avec PHP 5.3.0 + +3.23 (2009-07-30) + correction sur le calcul des DIVs + correction sur l'interpretation de certains styles CSS + correction de la fonction de creation d'index automatique CreateIndex + ATTENTION : la methode d'appel de CreateIndex a changé. Regardez l'exemple About !!!! + +3.22a (2009-06-16) + redistribution de HTML2PDF sous la licence LGPL !!! (au lieu de GPL) + +3.22 (2009-06-08) + correction sur le background-color + refonte totale de la gestion de text-align. les valeurs center et right marchent maintenant meme en cas de contenu riche + +3.21 (2009-05-05) + ajout de la propriété css FLOAT pour la balise IMG + correction sur la gestion des TFOOT + correction sur le positionnement des images + +3.20 (2009-04-06) + ajout de la gestion des margins pour la balise DIV + ajout de la gestion de la propriete css LINE-HEIGHT + correction sur l'interpretation de la valeur de certains styles CSS (background-image, background-position, ...) + correction sur la reconnaissance des balises thead et tfoot + correction sur la balise select + correction sur les fichiers de langue (merci à Sinan) + +3.19 (2009-03-11) + optimisation du parseur HTML - merci à Jezelinside + ajout de la balise TFOOT + amélioration de la gestion des tableaux : les contenus des balises THEAD et TFOOT sont maintenant répétés sur chaque page. + ajout de la balise spécifique BOOKMARK afin de créer des "marques-page" + possibilité de rajouter un index automatique en fin de fichier + ajout de la langue turque TR (merci à Hidayet) + amélioration de la méthode Output. Elle est maintenant également utilisable comme celle de FPDF + +3.18 (2009-02-22) + correction sur les sauts de page automatique pour les balises TABLE, UL, OL + correction sur l'interpretation des styles pour la balise HR + correction sur l'interpretation du style border-collapse pour la balise TABLE + prise en compte de margin:auto pour les tables et les divs + les commentaires dans les CSS sont acceptés + +3.17 (2008-12-30) + ajout de la gestion des balises INPUT (text, radio, checkbox, button, hidden, ...), SELECT, OPTION, TEXTAREA (cf exemple 14) + ajout de la possibilité de mettre des scripts dans le pdf, via $html2pdf->pdf->IncludeJS(...); (cf exemples JS) + correction sur le saut de page automatique pour les images + correction sur les sauts de lignes automatiques pour certaines balises (UL, P, ...) + ajout de la langue NL (merci à Roland) + +3.16 (2008-12-09) + ajout de la gestion de list-style: none (cf exemple 13) + correction dans la gestion des fontes ajoutées à fpdf (via la méthode AddFont) + nombreuses corrections sur le calcul des largeurs des éléments table, div, hr, td, th + ajout de l'exemple about.php + (pour info, les PDF générés à partir des exemples sont maintenant dans le répertoire /exemples/pdf/, et sont supprimables) + +3.15 (2008-12-01) + correction sur l'identification des styles en cas de valeurs multiples dans la propriete class + prise en compte de border-radius pour la limite des backgrounds (color et image) + ajout des proprietes CSS border-top-*, border-right-*, border-bottom-*, border-left-* + ajout de la propriété CSS list-style-image (cf exemple 12) + pour la balise table, ajout de l'interprétation de align="center" et align="right" (cf exemple 1) + correction dans le positionnement des images + correction de quelques bugs + ajout d'une fonction d'analyse des ressources HTML2PDFgetTimerDebug (cf début du fichier html2pdf.class.php) + +3.14 (2008-11-17) + ajout d'une langue (pt : Brazilian Portuguese language) et amelioration de la methode vueHTML (merci à Rodrigo) + correction du positionnement du contenu des DIVs. gestion des proprietes valign et align + ajout de la propriete CSS border-collapse (cf exemple 0) + ajout de la propriete CSS border-radius (cf exemple 1) + correction de quelques bugs + +3.13 (2008-09-24) + reecriture de la balise hr, avec prise en compte des styles (cf exemple 0) + ajout de la propriete backcolor pour la balise page (cf exemple 9) + ajout des proprietes backleft et backright pour la balise page afin de pouvoir changer les marges des pages (cf exemple 8) + nombreuses corrections sur les balises et les styles + +3.12 (2008-09-16) + ajout des balises ol, ul, li (cf exemple 12) + correction sur le calcul de la taille des td en cas de colspan et rowspan + ajout de la méthode setTestTdInOnePage afin de pouvoir desactiver le test sur la taille des TD (cf exemple 11) + correction de quelques bugs + +3.11 (2008-08-29) + ajout des balises div, p, pre, s + gestion des styles CSS position (relative, absolute), left, top, right, bottom (cf exemple 10) + meilleur gestion des border : border-style, border-color, border-width (cf exemple 10) + possibilité d'indiquer les marges par défault, via le constructeur (cf exemple 2) + +3.10a (2008-08-26) + correction pour compatibilité php4 / php5 + +3.10 (2008-08-25) + ajout des liens internes (cf exemple 7) + gestion complete des background : image, repeat, position, color (cf exemple 1) + gestion de underline, overline, linethrough (cf exemple 2) + correction de quelques bugs + +3.09 + mise à jour vers fpdf version 1.6, ajout de barcode, correction de l'affichage de certains caractères spéciaux + correction du calcul de la hauteur de ligne de la balise br + detection en cas de contenu trop grand dans un TD + amélioration de la balise page (ajout de l'attribue pageset, avec les valeurs new et old) + ajout de FPDF_PROTECTION, accesible via $pdf->pdf->SetProtection(...) + +3.08 + version opérationnelle de page_header + ajout de page_footer + correction des borders des tableaux + +3.07 + correction de l'interpretation de cellspacing, + amélioration de la balise page_header + +3.06 + première gestion de la balise page_header + correction des dimensions des tableaux + +3.05 + ajout de la propriété vertical-align + ajout de la gestion des fichiers de langue + +3.04 + correction du saut de page automatique pour les tableaux + Ajout de propriétés à la balise PAGE + +3.03 + correction de bugs au niveau de la gestion des images PHP par FPDF + meilleure gestion des erreurs + +3.02 + ajout de la gestion des noms des couleurs + correction de la gestion des images générées par php + correction de quelques bugs + +3.01 + correction de quelques bugs + ajout d'une protection pour les balises non existantes + +3.00 + refonte totale du calcul des tableaux + Prise en compte des colspan et rowspan + +2.85 + ajout de la propriété cellspacing + nouvelle gestion des padding des tableaux + +2.80 + ajout des types de border dotted et dasheds + +2.75 + ajout des top, left, right, bottom pour padding et border + +2.70 + correction de la balise HR, ajout de la propriété padding pour les table, th, td + correction des dimensions, les unités px, mm, in, pt sont enfin réellement reproduites, correction de font-size, border, ... + ajout d'une propriété à la balise page : footer + correction dans l'affichage et le calcul des tables + +2.55 + vérification de la validité du code (ouverture / fermeture) + ajout des unités mm, in, pt + +2.50 + correction de nobreak + correction des marges + ajout de nombreuses balises + +2.40 + refonte totale de l'identification des styles CSS (Les héritages marchent) + +2.39 + corrections diverses + ajout de certaines propriétés (bgcolor, ...) + +2.38 + meilleur identification des propriétés border et color + +2.37 + nombreuses corrections : + balise A + couleur de fond + retour à la ligne + gestion des images dans un texte + +2.36 + ajout de la balises STRONG + ajout de la balise EM + +2.35 + amélioration de la gestion des feuilles de style + +2.31 + correction de quelques bugs + +2.30 + première version opérationnel des feuilles de style + +2.25 + ajout de la balise LINK pour le type text/css + +2.20 + premier jet de la gestion des feuilles de style, ajout de la balise STYLE + +2.15 + n'interpréte plus l'HTML en commentaire <!-- --> + +2.10 + ajout des balises H1 -> H6 + +2.01 + correction de quelques bugs + +2.00 + première version diffusée \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/exception.class.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/exception.class.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/exception.class.php 2012-12-02 23:36:20 UTC (rev 10310) @@ -0,0 +1,168 @@ +<?php +/** + * HTML2PDF Librairy - HTML2PDF Exception + * + * HTML => PDF convertor + * distributed under the LGPL License + * + * @author Laurent MINGUET <web...@ht...> + * @version 4.03 + */ + +class HTML2PDF_exception extends exception +{ + protected $_tag = null; + protected $_html = null; + protected $_other = null; + protected $_image = null; + protected $_messageHtml = ''; + + /** + * generate a HTML2PDF exception + * + * @param int $err error number + * @param mixed $other additionnal informations + * @return string $html optionnal code HTML associated to the error + */ + final public function __construct($err = 0, $other = null, $html = '') + { + // read the error + switch($err) + { + case 1: // Unsupported tag + $msg = (HTML2PDF_locale::get('err01')); + $msg = str_replace('[[OTHER]]', $other, $msg); + $this->_tag = $other; + break; + + case 2: // too long sentence + $msg = (HTML2PDF_locale::get('err02')); + $msg = str_replace('[[OTHER_0]]', $other[0], $msg); + $msg = str_replace('[[OTHER_1]]', $other[1], $msg); + $msg = str_replace('[[OTHER_2]]', $other[2], $msg); + break; + + case 3: // closing tag in excess + $msg = (HTML2PDF_locale::get('err03')); + $msg = str_replace('[[OTHER]]', $other, $msg); + $this->_tag = $other; + break; + + case 4: // tags closed in the wrong order + $msg = (HTML2PDF_locale::get('err04')); + $msg = str_replace('[[OTHER]]', print_r($other, true), $msg); + break; + + case 5: // unclosed tag + $msg = (HTML2PDF_locale::get('err05')); + $msg = str_replace('[[OTHER]]', print_r($other, true), $msg); + break; + + case 6: // image can not be loaded + $msg = (HTML2PDF_locale::get('err06')); + $msg = str_replace('[[OTHER]]', $other, $msg); + $this->_image = $other; + break; + + case 7: // too big TD content + $msg = (HTML2PDF_locale::get('err07')); + break; + + case 8: // SVG tag not in DRAW tag + $msg = (HTML2PDF_locale::get('err08')); + $msg = str_replace('[[OTHER]]', $other, $msg); + $this->_tag = $other; + break; + + case 9: // deprecated + $msg = (HTML2PDF_locale::get('err09')); + $msg = str_replace('[[OTHER_0]]', $other[0], $msg); + $msg = str_replace('[[OTHER_1]]', $other[1], $msg); + $this->_tag = $other[0]; + break; + + case 0: // specific error + default: + $msg = $other; + break; + } + + // create the HTML message + $this->_messageHtml = '<span style="color: #AA0000; font-weight: bold;">'.HTML2PDF_locale::get('txt01', 'error: ').$err.'</span><br>'; + $this->_messageHtml.= HTML2PDF_locale::get('txt02', 'file:').' '.$this->file.'<br>'; + $this->_messageHtml.= HTML2PDF_locale::get('txt03', 'line:').' '.$this->line.'<br>'; + $this->_messageHtml.= '<br>'; + $this->_messageHtml.= $msg; + + // create the text message + $msg = HTML2PDF_locale::get('txt01', 'error: ').$err.' : '.strip_tags($msg); + + // add the optionnal html content + if ($html) { + $this->_messageHtml.= "<br><br>HTML : ...".trim(htmlentities($html)).'...'; + $this->_html = $html; + $msg.= ' HTML : ...'.trim($html).'...'; + } + + // save the other informations + $this->_other = $other; + + // construct the exception + parent::__construct($msg, $err); + } + + /** + * get the message as string + * + * @access public + * @return string $messageHtml + */ + public function __toString() + { + return $this->_messageHtml; + } + + /** + * get the html tag name + * + * @access public + * @return string $tagName + */ + public function getTAG() + { + return $this->_tag; + } + + /** + * get the optional html code + * + * @access public + * @return string $html + */ + public function getHTML() + { + return $this->_html; + } + + /** + * get the optional other informations + * + * @access public + ... [truncated message content] |
From: <ma...@us...> - 2012-12-02 21:34:53
|
Revision: 10309 http://sourceforge.net/p/xoops/svn/10309 Author: mageg Date: 2012-12-02 21:34:50 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Update page module Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/content.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/form/page_content.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/form/page_related.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/page.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_print.html Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/content.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/content.php 2012-12-02 21:18:49 UTC (rev 10308) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/content.php 2012-12-02 21:34:50 UTC (rev 10309) @@ -16,7 +16,7 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package page * @since 2.6.0 - * @author Mage Gr\xE9gory (AKA Mage) + * @author Mage Gr�gory (AKA Mage) * @version $Id$ */ include dirname(__FILE__) . '/header.php'; @@ -188,7 +188,7 @@ } if (preg_match('/^\d+$/', $_POST["content_weight"]) == false){ $error = true; - $error_message .= _AM_PAGE_CATEGORY_ERROR_WEIGHT . '<br />'; + $error_message .= _AM_PAGE_CONTENT_ERROR_WEIGHT . '<br />'; $obj->setVar("content_weight", ''); } else { $obj->setVar("content_weight", $_POST["content_weight"]); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/form/page_content.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/form/page_content.php 2012-12-02 21:18:49 UTC (rev 10308) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/form/page_content.php 2012-12-02 21:34:50 UTC (rev 10309) @@ -16,7 +16,7 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package page * @since 2.6.0 - * @author Mage Gr\xE9gory (AKA Mage) + * @author Mage Gr�gory (AKA Mage) * @version $Id$ */ @@ -25,7 +25,7 @@ class PagePage_contentForm extends XoopsThemeForm { /** - * @param XoopsPagePage_content|XoopsObject $obj + * @param PagePage_content|XoopsObject $obj */ public function __construct(PagePage_content &$obj) { @@ -80,7 +80,7 @@ $content_option = array('title', 'author', 'date', 'hits', 'rating', 'coms', 'ncoms', 'notifications', 'pdf', 'print', 'mail', 'social'); $content_status = 1; $content_maindisplay = 1; - } + } //title $this->addElement(new XoopsFormText(_AM_PAGE_CONTENT_TITLE, 'content_title', 6, 255, $obj->getVar('content_title'), ''), true); //short text @@ -131,7 +131,7 @@ $this->addElement(new XoopsFormRadioYN(_AM_PAGE_CONTENT_MAINDISPLAY, 'content_maindisplay', $content_maindisplay)); //active $this->addElement(new XoopsFormRadioYN(_AM_PAGE_CONTENT_STATUS, 'content_status', $content_status)); - + if ( $xoops->user->isAdmin($xoops->module->mid()) ) { //author if ($obj->isNew()) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/form/page_related.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/form/page_related.php 2012-12-02 21:18:49 UTC (rev 10308) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/form/page_related.php 2012-12-02 21:34:50 UTC (rev 10309) @@ -16,7 +16,7 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package page * @since 2.6.0 - * @author Mage Gr\xE9gory (AKA Mage) + * @author Mage Gr�gory (AKA Mage) * @version $Id$ */ @@ -25,7 +25,7 @@ class PagePage_relatedForm extends XoopsThemeForm { /** - * @param XoopsPagePage_content|XoopsObject $obj + * @param PagePage_related|XoopsObject $obj */ public function __construct(PagePage_related &$obj) { @@ -37,7 +37,7 @@ $title = $obj->isNew() ? sprintf( _AM_PAGE_RELATED_ADD ) : sprintf( _AM_PAGE_RELATED_EDIT ); parent::__construct($title, 'form', 'related.php', 'post', true); - + $secondary_max = 10; $this->addElement(new XoopsFormHidden( 'secondary_max', $secondary_max ) ); $criteria_related = new CriteriaCompo(); @@ -64,7 +64,7 @@ for ($i = 1; $i <= $secondary_max; $i++) { $related_secondary[$i] = 0; } - + } $compare_related_arr = $related_Handler->getall($criteria_related); if (count($compare_related_arr) > 0) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/page.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/page.php 2012-12-02 21:18:49 UTC (rev 10308) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/page.php 2012-12-02 21:34:50 UTC (rev 10309) @@ -16,7 +16,7 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package page * @since 2.6.0 - * @author Mage Gr\xE9gory (AKA Mage) + * @author Mage Gr�gory (AKA Mage) * @version $Id$ */ @@ -28,7 +28,6 @@ { $xoops = Xoops::getInstance(); // Get handler - $content_Handler = $xoops->getModuleHandler('page_content'); $related_Handler = $xoops->getModuleHandler('page_related'); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('related_contentid', $content_id)); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_print.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_print.html 2012-12-02 21:18:49 UTC (rev 10308) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_print.html 2012-12-02 21:34:50 UTC (rev 10309) @@ -27,8 +27,7 @@ <![endif]--> </head> -<!--<body class="<{$xoops_langcode}>" onload="window.print()">--> -<body class="<{$xoops_langcode}>"> +<body class="<{$xoops_langcode}>" onload="window.print()"> <div id="page-print"> <div id="page-logo-print"> <img src="<{$xoops_url}>/images/logo.png" alt="<{$xoops_sitename}>" /> |
From: <ma...@us...> - 2012-12-02 21:18:51
|
Revision: 10308 http://sourceforge.net/p/xoops/svn/10308 Author: mageg Date: 2012-12-02 21:18:49 +0000 (Sun, 02 Dec 2012) Log Message: ----------- rename renderbanner.php in bannerrender.php Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/blocks/banners_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/preloads/core.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerrender.php Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/renderbanner.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/blocks/banners_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/blocks/banners_blocks.php 2012-12-02 20:40:24 UTC (rev 10307) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/blocks/banners_blocks.php 2012-12-02 21:18:49 UTC (rev 10308) @@ -16,14 +16,14 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package banners * @since 2.6.0 - * @author Mage Gr\xE9gory (AKA Mage) + * @author Mage Gr�gory (AKA Mage) * @version $Id$ */ function banners_blocks_show($options) { $block = array(); $xoops = Xoops::getInstance(); - require_once dirname(dirname(__FILE__)) . '/class/renderbanner.php'; - $render = new RenderBanner(); + require_once dirname(dirname(__FILE__)) . '/class/bannerrender.php'; + $render = new BannerRender(); switch ($options[0]) { case 'random': $nb_display = $options[1]; Copied: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerrender.php (from rev 10307, XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/renderbanner.php) =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerrender.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerrender.php 2012-12-02 21:18:49 UTC (rev 10308) @@ -0,0 +1,112 @@ +<?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. +*/ + +/** + * banners module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package banners + * @since 2.6.0 + * @author Mage Gr�gory (AKA Mage) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class BannerRender +{ + /** + * Constructor + */ + public function __construct() + { + } + + /** + * Display banner + * + * @param $nb_banner + * @param $align + * @param $client + * @param $ids + * + * @return string + */ + public function displayBanner($nb_banner = 1, $align = 'H', $client = array(), $ids = '') + { + $xoops = Xoops::getInstance(); + if ($xoops->isActiveModule('banners')) { + // Get banners handler + $banner_Handler = $xoops->getModuleHandler('banner', 'banners'); + // Display banner + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('status', 0, '!=')); + $criteria->setSort('RAND()'); + if (!empty($client)) { + if (!in_array(0, $client)) { + $criteria->add(new Criteria('cid', '(' . implode(',', $client) . ')', 'IN')); + } + } + if ($ids == '') { + $criteria->setLimit($nb_banner); + $criteria->setStart(0); + } else { + $criteria->add(new Criteria('bid', '(' . $ids . ')', 'IN')); + } + $banner_arr = $banner_Handler->getall($criteria); + $numrows = count($banner_arr); + $bannerobject = ''; + if ($numrows > 0) { + foreach (array_keys($banner_arr) as $i) { + $imptotal = $banner_arr[$i]->getVar("imptotal"); + $impmade = $banner_arr[$i]->getVar("impmade"); + $htmlbanner = $banner_arr[$i]->getVar("htmlbanner"); + $htmlcode = $banner_arr[$i]->getVar("htmlcode"); + $imageurl = $banner_arr[$i]->getVar("imageurl"); + $bid = $banner_arr[$i]->getVar("bid"); + $clickurl = $banner_arr[$i]->getVar("clickurl"); + /** + * Print the banner + */ + if ($htmlbanner) { + $bannerobject .= $htmlcode; + } else { + if (stristr($imageurl, '.swf')) { + $bannerobject .= '<a href="' . XOOPS_URL . '/modules/banners/index.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"></a>' . '<object type="application/x-shockwave-flash" width="468" height="60" data="' . $imageurl . '" style="z-index:100;">' . '<param name="movie" value="' . $imageurl . '" />' . '<param name="wmode" value="opaque" />' . '</object>'; + } else { + $bannerobject .= '<a href="' . XOOPS_URL . '/modules/banners/index.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"><img src="' . $imageurl . '" alt="' . $clickurl . '" /></a>'; + } + } + if ($align == 'V') { + $bannerobject .= '<br /><br />'; + } else { + $bannerobject .= ' '; + } + if ($xoops->getModuleConfig('banners_myip', 'banners') == $xoops->getEnv('REMOTE_ADDR')) { + // EMPTY + } else { + /** + * Check if this impression is the last one + */ + $impmade = $impmade + 1; + if ($imptotal > 0 && $impmade >= $imptotal) { + $xoops->db->queryF(sprintf('UPDATE %s SET status = %u, dateend = %u WHERE bid = %u', $xoops->db->prefix('banner'), 0, time(), $bid)); + } else { + $xoops->db->queryF(sprintf('UPDATE %s SET impmade = %u WHERE bid = %u', $xoops->db->prefix('banner'), $impmade, $bid)); + } + } + } + return $bannerobject; + } + } + } +} \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/renderbanner.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/renderbanner.php 2012-12-02 20:40:24 UTC (rev 10307) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/renderbanner.php 2012-12-02 21:18:49 UTC (rev 10308) @@ -1,111 +0,0 @@ -<?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. -*/ - -/** - * banners module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package banners - * @since 2.6.0 - * @author Mage Gr\xE9gory (AKA Mage) - * @version $Id$ - */ - -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class RenderBanner -{ - /** - * Constructor - */ - public function __construct() - { - - } - - /** - * Display banner - * @param $nb_banner - * @param $align - * @param $client - * @param $ids - * @return string - */ - public function displayBanner($nb_banner = 1, $align = 'H', $client = array(), $ids = '') - { - $xoops = Xoops::getInstance(); - if ($xoops->isActiveModule('banners')) { - // Get banners handler - $banner_Handler = $xoops->getModuleHandler('banner','banners'); - // Display banner - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('status', 0, '!=')); - $criteria->setSort('RAND()'); - if (!empty($client)) { - if (!in_array(0,$client)) { - $criteria->add(new Criteria('cid', '(' . implode(',', $client) . ')','IN')); - } - } - if ($ids == '') { - $criteria->setLimit($nb_banner); - $criteria->setStart(0); - } else { - $criteria->add(new Criteria('bid', '(' . $ids . ')','IN')); - } - $banner_arr = $banner_Handler->getall($criteria); - $numrows = count($banner_arr); - $bannerobject = ''; - if ($numrows > 0) { - foreach (array_keys($banner_arr) as $i) { - $imptotal = $banner_arr[$i]->getVar("imptotal"); - $impmade = $banner_arr[$i]->getVar("impmade"); - $htmlbanner = $banner_arr[$i]->getVar("htmlbanner"); - $htmlcode = $banner_arr[$i]->getVar("htmlcode"); - $imageurl = $banner_arr[$i]->getVar("imageurl"); - $bid = $banner_arr[$i]->getVar("bid"); - $clickurl = $banner_arr[$i]->getVar("clickurl"); - /** - * Print the banner - */ - if ($htmlbanner) { - $bannerobject .= $htmlcode; - } else { - if (stristr($imageurl, '.swf')) { - $bannerobject .= '<a href="' . XOOPS_URL . '/modules/banners/index.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"></a>' . '<object type="application/x-shockwave-flash" width="468" height="60" data="' . $imageurl . '" style="z-index:100;">' . '<param name="movie" value="' . $imageurl . '" />' . '<param name="wmode" value="opaque" />' . '</object>'; - } else { - $bannerobject .= '<a href="' . XOOPS_URL . '/modules/banners/index.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"><img src="' . $imageurl . '" alt="' . $clickurl . '" /></a>'; - } - } - if ($align == 'V') { - $bannerobject .= '<br /><br />'; - } else { - $bannerobject .= ' '; - } - if ($xoops->getModuleConfig('banners_myip', 'banners') == $xoops->getEnv('REMOTE_ADDR')) { - // EMPTY - } else { - /** - * Check if this impression is the last one - */ - $impmade = $impmade + 1; - if ($imptotal > 0 && $impmade >= $imptotal) { - $xoops->db->queryF(sprintf('UPDATE %s SET status = %u, dateend = %u WHERE bid = %u', $xoops->db->prefix('banner'), 0, time(), $bid)); - }else{ - $xoops->db->queryF(sprintf('UPDATE %s SET impmade = %u WHERE bid = %u', $xoops->db->prefix('banner'), $impmade, $bid)); - } - } - } - return $bannerobject; - } - } - } -} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/preloads/core.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/preloads/core.php 2012-12-02 20:40:24 UTC (rev 10307) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/preloads/core.php 2012-12-02 21:18:49 UTC (rev 10308) @@ -16,7 +16,7 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package banners * @since 2.6.0 - * @author Mage Gr\xE9gory (AKA Mage) + * @author Mage Gr�gory (AKA Mage) * @version $Id$ */ @@ -27,7 +27,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @author Mage Gr\xE9gory (AKA Mage) + * @author Mage Gr�gory (AKA Mage) */ class BannersCorePreload extends XoopsPreloadItem { @@ -38,8 +38,8 @@ */ static public function eventCoreBannerDisplay($args) { - require_once dirname(dirname(__FILE__)) . '/class/renderbanner.php'; - $render = new RenderBanner(); + require_once dirname(dirname(__FILE__)) . '/class/bannerrender.php'; + $render = new BannerRender(); $args[0] = $render->displayBanner(); } } \ No newline at end of file |
From: <tr...@us...> - 2012-12-02 20:40:27
|
Revision: 10307 http://sourceforge.net/p/xoops/svn/10307 Author: trabis Date: 2012-12-02 20:40:24 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Updating profile module Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/activate.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/category.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/deactivate.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/permissions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/step.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/visibility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changemail.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/field.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/profile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/include/forms.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/register.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -87,7 +87,7 @@ /** * create a new user * - * @return object XoopsUser reference to the new user + * @return XoopsUser reference to the new user */ public function createUser() { @@ -99,7 +99,7 @@ * retrieve a group * * @param int $id ID for the group - * @return object XoopsGroup reference to the group + * @return XoopsGroup reference to the group */ public function getGroup($id) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -1032,7 +1032,7 @@ * @param bool $force flag to force the query execution despite security settings * @return mixed */ - public function insert($object, $force = true) + public function insert(XoopsObject $object, $force = true) { /* @var $handler XoopsModelWrite */ $handler = $this->loadHandler('write'); @@ -1046,7 +1046,7 @@ * @param bool $force * @return bool FALSE if failed. */ - public function delete($object, $force = false) + public function delete(XoopsObject $object, $force = false) { /* @var $handler XoopsModelWrite */ $handler = $this->loadHandler('write'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/activate.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/activate.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/activate.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -81,8 +81,10 @@ if (count($getuser) == 0) { $xoops->redirect(XOOPS_URL, 2, _US_SORRYNOTFOUND); } - if ($getuser[0]->isActive()) { - $xoops->redirect(XOOPS_URL, 2, sprintf(_US_ACONTACT, $getuser[0]->getVar('email'))); + /* @var XoopsUser $getuser */ + $getuser = $getuser[0]; + if ($getuser->isActive()) { + $xoops->redirect(XOOPS_URL, 2, sprintf(_US_ACONTACT, $getuser->getVar('email'))); } $xoopsMailer = $xoops->getMailer(); $xoopsMailer->useMail(); @@ -93,7 +95,7 @@ $xoopsMailer->setToUsers($getuser[0]); $xoopsMailer->setFromEmail($xoops->getConfig('adminmail')); $xoopsMailer->setFromName($xoops->getConfig('sitename')); - $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $getuser[0]->getVar('uname') )); + $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $getuser->getVar('uname') )); if (!$xoopsMailer->send()) { echo _US_YOURREGMAILNG; } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/category.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/category.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/category.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -23,10 +23,8 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); + // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); // Call header Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/deactivate.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/deactivate.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/deactivate.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -21,6 +21,7 @@ */ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); $xoops->header(); if (!isset($_REQUEST['uid'])) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -23,10 +23,8 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); + // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); // Call header Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/header.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/header.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/header.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -22,4 +22,5 @@ require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; XoopsLoad::load('system', 'system'); +$xoops = Xoops::getInstance(); $xoops->loadLanguage('user'); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/permissions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/permissions.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/permissions.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -23,10 +23,8 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); + // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'edit', 'string'); // Call header Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/step.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/step.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/step.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -23,10 +23,8 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); + // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); // Call header @@ -47,7 +45,7 @@ $xoops->tpl->assign('steps', $regstep_Handler->getObjects(null, true, false)); $xoops->tpl->assign('step', true); break; - + case "new": $admin_page->addItemButton(_PROFILE_AM_STEP_LIST, 'step.php', 'application-view-detail'); $admin_page->renderButton(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/visibility.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/visibility.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/visibility.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -23,10 +23,8 @@ include dirname(__FILE__) . '/header.php'; // Get main instance $system = System::getInstance(); -// Check users rights -if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { - exit(_NOPERM); -} +$xoops = Xoops::getInstance(); + //there is no way to override current tabs when using system menu //this dirty hack will have to do it $_SERVER['REQUEST_URI'] = "admin/permissions.php"; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changemail.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changemail.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changemail.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -52,7 +52,7 @@ } if ($errors) { - $msg = implode('<br />', $errros); + $msg = implode('<br />', $errors); } else { //update password $xoops->user->setVar('email', trim($_POST['newmail'])); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/field.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/field.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/field.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -190,10 +190,6 @@ $element = new XoopsFormDatetime($caption, $name, 15, $value); break; - case "list": - $element = new XoopsFormSelectList($caption, $name, $value, 1, $options[0]); - break; - case "timezone": $element = new XoopsFormSelectTimezone($caption, $name, $value); $element->setExtra("style='width: 280px;'"); @@ -445,8 +441,9 @@ $criteria = new Criteria('o.field_id', 0, "!="); $criteria->setSort('l.cat_weight ASC, o.field_weight'); $field_objs = $this->getByLink($criteria, array('o.*'), true, 'cat_id', 'cat_id'); - foreach (array_keys($field_objs) as $i) { - $fields[$field_objs[$i]->getVar('field_name')] = $field_objs[$i]; + /* @var ProfileField $field */ + foreach ($field_objs as $field) { + $fields[$field->getVar('field_name')] = $field; } } return $fields; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/profile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/profile.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/profile.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -41,13 +41,15 @@ /** * Initiate variables - * @param array $fields field information array of {@link XoopsProfileField} objects + * + * @param array $fields field information array of {@link ProfileField} objects */ public function init($fields) { if (is_array($fields) && count($fields) > 0) { - foreach (array_keys($fields) as $key) { - $this->initVar($key, $fields[$key]->getVar('field_valuetype'), $fields[$key]->getVar('field_default', 'n'), $fields[$key]->getVar('field_required'), $fields[$key]->getVar('field_maxlength')); + /* @var ProfileField $field */ + foreach ($fields as $key => $field) { + $this->initVar($key, $field->getVar('field_valuetype'), $field->getVar('field_default', 'n'), $field->getVar('field_required'), $field->getVar('field_maxlength')); } } } @@ -59,8 +61,10 @@ * @var bool|ProfileFieldHandler */ private $_fHandler; + /** - * Array of {@link XoopsProfileField} objects + * Array of {@link ProfileField} objects + * * @var array */ private $_fields = array(); @@ -93,8 +97,9 @@ /** * Get a {@link ProfileProfile} * - * @param $uid + * @param $uid * @param bool $createOnFailure create a new {@link ProfileProfile} if none is fetched + * * @return null|ProfileProfile|XoopsObject */ public function getProfile($uid, $createOnFailure = true) @@ -135,9 +140,9 @@ /** * Fetch fields * - * @param CriteriaElement $criteria {@link CriteriaElement} object - * @param bool $id_as_key return array with field IDs as key? - * @param bool $as_object return array of objects? + * @param CriteriaElement $criteria {@link CriteriaElement} object + * @param bool $id_as_key return array with field IDs as key? + * @param bool $as_object return array of objects? * * @return array **/ @@ -150,7 +155,7 @@ * Insert a field in the database * * @param ProfileField $field - * @param bool $force + * @param bool $force * * @return bool */ @@ -163,7 +168,7 @@ * Delete a field from the database * * @param ProfileField $field - * @param bool $force + * @param bool $force * * @return bool */ @@ -176,7 +181,8 @@ * Save a new field in the database * * @param array $vars array of variables, taken from $module->loadInfo('profile')['field'] - * @param int $weight + * @param int $weight + * * @return string */ public function saveField($vars, $weight = 0) @@ -230,8 +236,8 @@ /** * insert a new object in the database * - * @param XoopsObject|ProfileProfile $obj reference to the object - * @param bool $force whether to force the query execution despite security settings + * @param XoopsObject|ProfileProfile $obj reference to the object + * @param bool $force whether to force the query execution despite security settings * * @return bool FALSE if failed, TRUE if already present and unchanged or successful */ @@ -261,8 +267,8 @@ * Search profiles and users * * @param CriteriaElement $criteria CriteriaElement - * @param array $searchvars Fields to be fetched - * @param array $groups for Usergroups is selected (only admin!) + * @param array $searchvars Fields to be fetched + * @param array $groups for Usergroups is selected (only admin!) * * @return array */ @@ -282,8 +288,7 @@ } $sql_select = "SELECT " . (empty($searchvars) ? "u.*, p.*" : implode(", ", $sv)); - $sql_from = " FROM " . $this->db->prefix("users") . " AS u LEFT JOIN " . $this->table . " AS p ON u.uid=p.profile_id" . (empty($groups) - ? "" : " LEFT JOIN " . $this->db->prefix("groups_users_link") . " AS g ON u.uid=g.uid"); + $sql_from = " FROM " . $this->db->prefix("users") . " AS u LEFT JOIN " . $this->table . " AS p ON u.uid=p.profile_id" . (empty($groups) ? "" : " LEFT JOIN " . $this->db->prefix("groups_users_link") . " AS g ON u.uid=g.uid"); $sql_clause = " WHERE 1=1"; $sql_order = ""; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -66,10 +66,11 @@ $profile->setVar('profile_id', $edituser->getVar('uid')); } - foreach (array_keys($fields) as $i) { - $fieldname = $fields[$i]->getVar('field_name'); - if (in_array($fields[$i]->getVar('field_id'), $editable_fields) && isset($_REQUEST[$fieldname])) { - $value = $fields[$i]->getValueForSave($_REQUEST[$fieldname]); + /* @var ProfileField $field */ + foreach ($fields as $field) { + $fieldname = $field->getVar('field_name'); + if (in_array($field->getVar('field_id'), $editable_fields) && isset($_REQUEST[$fieldname])) { + $value = $field->getValueForSave($_REQUEST[$fieldname]); if (in_array($fieldname, $profile_handler->getUserVars())) { $edituser->setVar($fieldname, $value); } else { @@ -253,7 +254,9 @@ if ($user_avatar != 'avatars/blank.gif') { $avatars = $avatar_handler->getObjects(new Criteria('avatar_file', $user_avatar)); if (is_object($avatars[0])) { - $avatar_handler->addUser($avatars[0]->getVar('avatar_id'), $xoops->user->getVar('uid')); + /* @var XoopsAvatar $avatar */ + $avatar = $avatars[0]; + $avatar_handler->addUser($avatar->getVar('avatar_id'), $xoops->user->getVar('uid')); } } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/include/forms.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/include/forms.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/include/forms.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -73,17 +73,18 @@ $fields = $profile_handler->loadFields(); $_SESSION['profile_required'] = array(); $weights = array(); - foreach (array_keys($fields) as $i) { - if ($fields[$i]->getVar('step_id') == $step['step_id']) { - $fieldinfo['element'] = $fields[$i]->getEditElement($user, $profile); + /* @var ProfileField $field */ + foreach ($fields as $field) { + if ($field->getVar('step_id') == $step['step_id']) { + $fieldinfo['element'] = $field->getEditElement($user, $profile); //assign and check (=) - if ($fieldinfo['required'] = $fields[$i]->getVar('field_required')) { - $_SESSION['profile_required'][$fields[$i]->getVar('field_name')] = $fields[$i]->getVar('field_title'); + if ($fieldinfo['required'] = $field->getVar('field_required')) { + $_SESSION['profile_required'][$field->getVar('field_name')] = $field->getVar('field_title'); } - $key = $fields[$i]->getVar('cat_id'); + $key = $field->getVar('cat_id'); $elements[$key][] = $fieldinfo; - $weights[$key][] = $fields[$i]->getVar('field_weight'); + $weights[$key][] = $field->getVar('field_weight'); } } ksort($elements); @@ -194,28 +195,29 @@ $categories = array(); $all_categories = $cat_handler->getObjects(null, true, false); $count_fields = count($fields); - foreach (array_keys($fields) as $i) { - if (in_array($fields[$i]->getVar('field_id'), $editable_fields)) { + /* @var ProfileField $field */ + foreach ($fields as $field) { + if (in_array($field->getVar('field_id'), $editable_fields)) { // Set default value for user fields if available if ($user->isNew()) { - $default = $fields[$i]->getVar('field_default'); + $default = $field->getVar('field_default'); if ($default !== '' && $default !== null) { - $user->setVar($fields[$i]->getVar('field_name'), $default); + $user->setVar($field->getVar('field_name'), $default); } } - if ($profile->getVar($fields[$i]->getVar('field_name'), 'n') === null) { - $default = $fields[$i]->getVar('field_default', 'n'); - $profile->setVar($fields[$i]->getVar('field_name'), $default); + if ($profile->getVar($field->getVar('field_name'), 'n') === null) { + $default = $field->getVar('field_default', 'n'); + $profile->setVar($field->getVar('field_name'), $default); } - $fieldinfo['element'] = $fields[$i]->getEditElement($user, $profile); - $fieldinfo['required'] = $fields[$i]->getVar('field_required'); + $fieldinfo['element'] = $field->getEditElement($user, $profile); + $fieldinfo['required'] = $field->getVar('field_required'); - $key = @$all_categories[$fields[$i]->getVar('cat_id')]['cat_weight'] * $count_fields + $fields[$i]->getVar('cat_id'); + $key = @$all_categories[$field->getVar('cat_id')]['cat_weight'] * $count_fields + $field->getVar('cat_id'); $elements[$key][] = $fieldinfo; - $weights[$key][] = $fields[$i]->getVar('field_weight'); - $categories[$key] = @$all_categories[$fields[$i]->getVar('cat_id')]; + $weights[$key][] = $field->getVar('field_weight'); + $categories[$key] = @$all_categories[$field->getVar('cat_id')]; } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/register.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/register.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/register.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -91,10 +91,11 @@ $newuser = $member_handler->createUser(); $profile = $profile_handler->create(); if (count($fields) > 0) { - foreach (array_keys($fields) as $i) { - $fieldname = $fields[$i]->getVar('field_name'); + /* @var ProfileField $field */ + foreach ($fields as $field) { + $fieldname = $field->getVar('field_name'); if (in_array($fieldname, $userfields)) { - $default = $fields[$i]->getVar('field_default'); + $default = $field->getVar('field_default'); if ($default === '' || $default === null) { continue; } @@ -109,10 +110,11 @@ } // Lets merge current $_POST with $_SESSION['profile_post'] so we can have access to info submited in previous steps -// Get all fields that we can expect from a $_POST inlcuding our private '_message_' +// Get all fields that we can expect from a $_POST including our private '_message_' $fieldnames = array(); -foreach (array_keys($fields) as $i) { - $fieldnames[] = $fields[$i]->getVar('field_name'); +/* @var ProfileField $field */ +foreach ($fields as $field) { + $fieldnames[] = $field->getVar('field_name'); } $fieldnames = array_merge($fieldnames, $userfields); $fieldnames[] = '_message_'; @@ -136,16 +138,16 @@ } // Set vars from $_POST/$_SESSION['profile_post'] -foreach (array_keys($fields) as $field) { - if (!isset($_POST[$field])) { +foreach ($fields as $fieldname => $field) { + if (!isset($_POST[$fieldname])) { continue; } - $value = $fields[$field]->getValueForSave($_POST[$field]); + $value = $field->getValueForSave($_POST[$fieldname]); if (in_array($field, $userfields)) { - $newuser->setVar($field, $value); + $newuser->setVar($fieldname, $value); } else { - $profile->setVar($field, $value); + $profile->setVar($fieldname, $value); } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2012-12-02 19:22:48 UTC (rev 10306) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2012-12-02 20:40:24 UTC (rev 10307) @@ -160,26 +160,28 @@ } } } +$categories = array(); foreach (array_keys($cats) as $i) { $categories[$i] = $cats[$i]; } $profile = $profile_handler->getProfile($thisUser->getVar('uid')); // Add dynamic fields -foreach (array_keys($fields) as $i) { +/* @var ProfileField $field */ +foreach ($fields as $field) { //If field is not visible, skip - //if ( $field_ids_visible && !in_array($fields[$i]->getVar('field_id'), $field_ids_visible) ) continue; - if (!in_array($fields[$i]->getVar('field_id'), $field_ids_visible)) { + //if ( $field_ids_visible && !in_array($field->getVar('field_id'), $field_ids_visible) ) continue; + if (!in_array($field->getVar('field_id'), $field_ids_visible)) { continue; } - $cat_id = $fields[$i]->getVar('cat_id'); - $value = $fields[$i]->getOutputValue($thisUser, $profile); + $cat_id = $field->getVar('cat_id'); + $value = $field->getOutputValue($thisUser, $profile); if (is_array($value)) { $value = implode('<br />', array_values($value)); } if ($value) { - $categories[$cat_id]['fields'][] = array('title' => $fields[$i]->getVar('field_title'), 'value' => $value); - $weights[$cat_id][] = $fields[$i]->getVar('cat_id'); + $categories[$cat_id]['fields'][] = array('title' => $field->getVar('field_title'), 'value' => $value); + $weights[$cat_id][] = $field->getVar('cat_id'); } } @@ -197,17 +199,19 @@ if (count($mids) > 0 && count($allowed_mids) > 0) { foreach ($mids as $mid) { if (in_array($mid, $allowed_mids)) { - $results = $modules[$mid]->search('', '', 5, 0, $thisUser->getVar('uid')); + /* @var XoopsModule $module */ + $module = $modules[$mid]; + $results = $module->search('', '', 5, 0, $thisUser->getVar('uid')); $count = count($results); if (is_array($results) && $count > 0) { for ($i = 0; $i < $count; $i++) { if (isset($results[$i]['image']) && $results[$i]['image'] != '') { - $results[$i]['image'] = XOOPS_URL . '/modules/' . $modules[$mid]->getVar('dirname', 'n') . '/' . $results[$i]['image']; + $results[$i]['image'] = XOOPS_URL . '/modules/' . $module->getVar('dirname', 'n') . '/' . $results[$i]['image']; } else { $results[$i]['image'] = XOOPS_URL . '/images/icons/posticon2.gif'; } if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { - $results[$i]['link'] = XOOPS_URL . "/modules/" . $modules[$mid]->getVar('dirname', 'n') . "/" . $results[$i]['link']; + $results[$i]['link'] = XOOPS_URL . "/modules/" . $module->getVar('dirname', 'n') . "/" . $results[$i]['link']; } $results[$i]['title'] = $myts->htmlspecialchars($results[$i]['title']); $results[$i]['time'] = $results[$i]['time'] ? XoopsLocal::formatTimestamp($results[$i]['time']) : ''; @@ -218,11 +222,11 @@ $showall_link = ''; } $xoops->tpl->append('modules', array( - 'name' => $modules[$mid]->getVar('name'), 'results' => $results, + 'name' => $module->getVar('name'), 'results' => $results, 'showall_link' => $showall_link )); } - unset($modules[$mid]); + unset($modules[$mid], $module); } } } |
From: <tr...@us...> - 2012-12-02 19:22:51
|
Revision: 10306 http://sourceforge.net/p/xoops/svn/10306 Author: trabis Date: 2012-12-02 19:22:48 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Removing duplicate construct Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php 2012-12-02 19:11:27 UTC (rev 10305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php 2012-12-02 19:22:48 UTC (rev 10306) @@ -28,7 +28,7 @@ public $xcaptcha_path_plugin; public function __construct() - { + { $this->captchaHandler = XoopsCaptcha::getInstance(); $this->config = $this->loadConfig(); $this->plugin_List = $this->getPluginList(); @@ -36,11 +36,6 @@ $this->xcaptcha_path_plugin = XOOPS_ROOT_PATH . '/modules/xcaptcha/plugins'; } - public function Xcaptcha() - { - $this->__construct(); - } - static function getInstance() { static $instance; @@ -84,18 +79,18 @@ } public function loadConfigPlugin() - { + { $config = array(); - foreach ($this->plugin_List as $key ) { - $config = $this->loadConfig( $key ); + foreach ($this->plugin_List as $key ) { + $config = $this->loadConfig( $key ); } return $config; } public function VerifyData() - { - global $system; - $config = array(); + { + global $system; + $config = array(); $_POST['disabled'] = $system->CleanVars($_POST, 'disabled', false, 'boolean'); $_POST['mode'] = $system->CleanVars($_POST, 'mode', 'image', 'string'); $_POST['name'] = $system->CleanVars($_POST, 'name', 'xoopscaptcha', 'string'); |
From: <tr...@us...> - 2012-12-02 19:11:29
|
Revision: 10305 http://sourceforge.net/p/xoops/svn/10305 Author: trabis Date: 2012-12-02 19:11:27 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Adding Debug and Highlighter class Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Highlighter.php Modified: XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt 2012-12-02 18:59:19 UTC (rev 10304) +++ XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt 2012-12-02 19:11:27 UTC (rev 10305) @@ -4,6 +4,8 @@ 2012/12: Version 2.6.0 Alpha 2 =============================== Updating cache engines (trabis) +Adding Xoops_Highlighter class (trabis) +Adding Xoops_Debug class (trabis) =============================== 2012/08: Version 2.6.0 Alpha 1 Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php 2012-12-02 19:11:27 UTC (rev 10305) @@ -0,0 +1,48 @@ +<?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 XUUPS Project http://sourceforge.net/projects/xuups/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package class + * @since 2.6 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xoops_Debug +{ + /** + * Output a dump of a variable + * + * @param mixed $var variable which will be dumped + * @param bool $echo + * @param bool $exit + * + * @return string + */ + static function dump($var, $echo = true, $exit = false) + { + $myts = MyText |
From: <tr...@us...> - 2012-12-02 18:59:22
|
Revision: 10304 http://sourceforge.net/p/xoops/svn/10304 Author: trabis Date: 2012-12-02 18:59:19 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Updating Xoops Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-02 17:49:37 UTC (rev 10303) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-02 18:59:19 UTC (rev 10304) @@ -216,12 +216,6 @@ 'xoopsavatarhandler' => XOOPS_ROOT_PATH . '/kernel/avatar.php', 'xoopsavataruserlink' => XOOPS_ROOT_PATH . '/kernel/avataruserlink.php', 'xoopsavataruserlinkhandler' => XOOPS_ROOT_PATH . '/kernel/avataruserlink.php', - 'xoopsbanner' => XOOPS_ROOT_PATH . '/kernel/banner.php', - 'xoopsbannerhandler' => XOOPS_ROOT_PATH . '/kernel/banner.php', - 'xoopsbannerclient' => XOOPS_ROOT_PATH . '/kernel/bannerclient.php', - 'xoopsbannerclienthandler' => XOOPS_ROOT_PATH . '/kernel/bannerclient.php', - 'xoopsbannerfinish' => XOOPS_ROOT_PATH . '/kernel/bannerfinish.php', - 'xoopsbannerfinishhandler' => XOOPS_ROOT_PATH . '/kernel/bannerfinish.php', 'xoopsblock' => XOOPS_ROOT_PATH . '/kernel/block.php', 'xoopsblockhandler' => XOOPS_ROOT_PATH . '/kernel/block.php', 'xoopsblockmodulelink' => XOOPS_ROOT_PATH . '/kernel/blockmodulelink.php', Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php 2012-12-02 17:49:37 UTC (rev 10303) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php 2012-12-02 18:59:19 UTC (rev 10304) @@ -109,7 +109,8 @@ 'var' => array(), 'lib' => array(), 'modules' => array(), - 'themes' => array() + 'themes' => array(), + 'media' => array() ); /** @@ -158,6 +159,7 @@ $this->paths['lib'] = array(XOOPS_PATH, XOOPS_URL . 'browse.php'); $this->paths['modules'] = array(XOOPS_ROOT_PATH . '/modules', XOOPS_URL . '/modules'); $this->paths['themes'] = array(XOOPS_ROOT_PATH . '/themes', XOOPS_URL . '/themes'); + $this->paths['media'] = array(XOOPS_ROOT_PATH . '/media', XOOPS_URL . '/media'); $this->registry = Xoops_Registry::getInstance(); } @@ -369,7 +371,7 @@ * * @return bool */ - public function header($tpl_name = '') + public function header($tpl_name = null) { if ($this->isAdminSide) { return $this->_adminHeader($tpl_name); @@ -388,11 +390,18 @@ if ($tpl_name) { $tpl_info = $this->getTplInfo($tpl_name); $this->tpl_name = $tpl_info['tpl_name']; + } else { + $tpl_name = 'module:system|system_dummy.html'; + $tpl_info = $this->getTplInfo($tpl_name); + $this->tpl_name = $tpl_info['tpl_name']; } // for legacy support when template is set after header. $this->option['template_main'] = $this->tpl_name; + // Load xlanguage api + $this->preload->triggerEvent('core.language.common'); + $xoopsThemeFactory = null; $xoopsThemeFactory = new XoopsThemeFactory(); $xoopsThemeFactory->allowedThemes = $this->getConfig('theme_set_allowed'); @@ -402,6 +411,9 @@ $this->preload->triggerEvent('core.header.addmeta'); + // common preload : xlanguage block, ... + $this->preload->triggerEvent('core.header.common'); + // Temporary solution for start page redirection if (defined("XOOPS_STARTPAGE_REDIRECTED")) { $this->theme->headContent(null, "<base href='" . XOOPS_URL . '/modules/' . $this->getConfig('startpage') . "/' />", null, null); @@ -427,7 +439,7 @@ // Tricky solution for setting cache time for homepage } else { if ($this->tpl_name == 'module:system|system_homepage.html') { - //$this->theme->contentCacheLifetime = 604800; + $this->theme->contentCacheLifetime = 604800; } } @@ -579,26 +591,6 @@ /** * @param mixed $optional * - * @return XoopsBannerHandler - */ - public function getHandlerBanner($optional = false) - { - return $this->getHandler('banner', $optional); - } - - /** - * @param mixed $optional - * - * @return XoopsBannerclientHandler - */ - public function getHandlerBannerclient($optional = false) - { - return $this->getHandler('bannerclient', $optional); - } - - /** - * @param mixed $optional - * * @return XoopsBlockHandler */ public function getHandlerBlock($optional = false) @@ -1098,7 +1090,7 @@ */ public function error($msg, $title = '') { - echo '<div class="errorMsg alert-message error">'; + echo '<div class="alert alert-error">'; if ($title != '') { echo '<strong>' . $title . '</strong><br /><br />'; } @@ -1158,25 +1150,25 @@ public function confirm($hiddens, $action, $msg, $submit = '', $addtoken = true) { $submit = ($submit != '') ? trim($submit) : _SUBMIT; - echo '<div class="confirmMsg">' . $msg . '<br /> - <form method="post" action="' . $action . '">'; + $this->tpl->assign('msg', $msg); + $this->tpl->assign('action', $action); + $this->tpl->assign('submit', $submit); + $str_hiddens = ''; foreach ($hiddens as $name => $value) { if (is_array($value)) { foreach ($value as $caption => $newvalue) { - echo '<input type="radio" name="' . $name . '" value="' . htmlspecialchars($newvalue) . '" /> ' . $caption; + $str_hiddens .= '<input type="radio" name="' . $name . '" value="' . htmlspecialchars($newvalue) . '" > ' . $caption . NWLINE; } - echo '<br />'; + $str_hiddens .= '<br />' . NWLINE; } else { - echo '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />'; + $str_hiddens .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />' . NWLINE; } } if ($addtoken != false) { - echo $this->security->getTokenHTML(); + $this->tpl->assign('token', $this->security->getTokenHTML()); } - echo '<input type="submit" name="confirm_submit" value="' . $submit . '" title="' . $submit . '"/> - <input type="button" name="confirm_back" value="' . _CANCEL . '" onclick="javascript:history.go(-1);" title="' . _CANCEL . '" /> - </form> - </div>'; + $this->tpl->assign('hiddens', $str_hiddens); + $this->tpl->display('module:system|system_confirm.html'); } /** @@ -1296,80 +1288,13 @@ /** * Function to get banner html tags for use in templates * - * @param int $nb_banner - * @param string $align - * @param array $client - * @param string $ids - * * @return string */ - public function getBanner($nb_banner = 1, $align = 'H', $client = array(), $ids = '') + public function getBanner() { - if ($this->isActiveModule('banners')) { - // Get banners handler - $banner_Handler = $this->getHandlerBanner(); - // Display banner - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('status', 0, '!=')); - $criteria->setSort('RAND()'); - if (!empty($client)) { - if (!in_array(0,$client)) { - $criteria->add(new Criteria('cid', '(' . implode(',', $client) . ')','IN')); - } - } - if ($ids == '') { - $criteria->setLimit($nb_banner); - $criteria->setStart(0); - } else { - $criteria->add(new Criteria('bid', '(' . $ids . ')','IN')); - } - $banner_arr = $banner_Handler->getall($criteria); - $numrows = count($banner_arr); - $bannerobject = ''; - if ($numrows > 0) { - foreach (array_keys($banner_arr) as $i) { - $imptotal = $banner_arr[$i]->getVar("imptotal"); - $impmade = $banner_arr[$i]->getVar("impmade"); - $htmlbanner = $banner_arr[$i]->getVar("htmlbanner"); - $htmlcode = $banner_arr[$i]->getVar("htmlcode"); - $imageurl = $banner_arr[$i]->getVar("imageurl"); - $bid = $banner_arr[$i]->getVar("bid"); - $clickurl = $banner_arr[$i]->getVar("clickurl"); - /** - * Print the banner - */ - if ($htmlbanner) { - $bannerobject .= $htmlcode; - } else { - if (stristr($imageurl, '.swf')) { - $bannerobject .= '<a href="' . XOOPS_URL . '/modules/banners/index.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"></a>' . '<object type="application/x-shockwave-flash" width="468" height="60" data="' . $imageurl . '" style="z-index:100;">' . '<param name="movie" value="' . $imageurl . '" />' . '<param name="wmode" value="opaque" />' . '</object>'; - } else { - $bannerobject .= '<a href="' . XOOPS_URL . '/modules/banners/index.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"><img src="' . $imageurl . '" alt="' . $clickurl . '" /></a>'; - } - } - if ($align == 'V') { - $bannerobject .= '<br /><br />'; - } else { - $bannerobject .= ' '; - } - if ($this->getModuleConfig('banners_myip', 'banners') == $this->getEnv('REMOTE_ADDR')) { - // EMPTY - } else { - /** - * Check if this impression is the last one - */ - $impmade = $impmade + 1; - if ($imptotal > 0 && $impmade >= $imptotal) { - $this->db->queryF(sprintf('UPDATE %s SET status = %u, dateend = %u WHERE bid = %u', $this->db->prefix('banner'), 0, time(), $bid)); - }else{ - $this->db->queryF(sprintf('UPDATE %s SET impmade = %u WHERE bid = %u', $this->db->prefix('banner'), $impmade, $bid)); - } - } - } - return $bannerobject; - } - } - return ''; + $options = ''; + $this->preload->triggerEvent('core.banner.display', array(&$options)); + return $options; } /** @@ -1582,15 +1507,16 @@ /** * @param string $key * @param string $type + * @param int $module * * @return mixed */ - public function getConfig($key, $type = 'XOOPS_CONF') + public function getConfig($key, $type = 'XOOPS_CONF', $module = 0) { if (isset($this->_systemConfigs[$key])) { return $this->_systemConfigs[$key]; } - $this->getConfigs($type); + $this->getConfigs($type, $module); if (!isset($this->_systemConfigs[$key])) { $this->_systemConfigs[$key] = ''; } @@ -1599,13 +1525,14 @@ /** * @param string $type + * @param int $module * * @return array */ - public function getConfigs($type = 'XOOPS_CONF') + public function getConfigs($type = 'XOOPS_CONF', $module = 0) { $configs = $this->getHandlerConfig() - ->getConfigsByCat((is_array($type)) ? $type : (!defined($type) ? $type : constant($type))); + ->getConfigsByCat((is_array($type)) ? $type : (!defined($type) ? $type : constant($type)), $module); $this->_systemConfigs = array_merge($this->_systemConfigs, $configs); $this->config =& $this->_systemConfigs; //for compatibilty return $this->_systemConfigs; |
From: <tr...@us...> - 2012-12-02 17:49:40
|
Revision: 10303 http://sourceforge.net/p/xoops/svn/10303 Author: trabis Date: 2012-12-02 17:49:37 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Moving XoopsRegistry to lib folder Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Registry.php Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/registry.php Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/registry.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/registry.php 2012-12-02 17:33:39 UTC (rev 10302) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/registry.php 2012-12-02 17:49:37 UTC (rev 10303) @@ -1,210 +0,0 @@ -<?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. -*/ - -/** - * Registry - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package class - * @since 2.6.0 - * @author trabis <lus...@gm...> - * @version $Id$ - */ - -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Zend Framework - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://framework.zend.com/license/new-bsd - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to li...@ze... so we can send you a copy immediately. - * - * @category Zend - * @package Zend_Registry - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class XoopsRegistry extends ArrayObject -{ - /** - * Class name of the singleton registry object. - * @var string - */ - private static $_registryClassName = 'XoopsRegistry'; - - /** - * Registry object provides storage for shared objects. - * @var XoopsRegistry - */ - private static $_registry = null; - - /** - * Retrieves the default registry instance. - * - * @return XoopsRegistry - */ - public static function getInstance() - { - if (self::$_registry === null) { - self::init(); - } - - return self::$_registry; - } - - /** - * Set the default registry instance to a specified instance. - * - * @param XoopsRegistry $registry An object instance of type XoopsRegistry, - * or a subclass. - * @return void - * @throws Zend_Exception if registry is already initialized. - */ - public static function setInstance(XoopsRegistry $registry) - { - if (self::$_registry !== null) { - trigger_error('Registry is already initialized'); - } - - self::setClassName(get_class($registry)); - self::$_registry = $registry; - } - - /** - * Initialize the default registry instance. - * - * @return void - */ - protected static function init() - { - self::setInstance(new self::$_registryClassName()); - } - - /** - * Set the class name to use for the default registry instance. - * Does not affect the currently initialized instance, it only applies - * for the next time you instantiate. - * - * @param string $registryClassName - * @return void - * @throws Zend_Exception if the registry is initialized or if the - * class name is not valid. - */ - public static function setClassName($registryClassName = 'XoopsRegistry') - { - if (self::$_registry !== null) { - trigger_error('Registry is already initialized'); - } - - if (!is_string($registryClassName)) { - trigger_error("Argument is not a class name"); - } - - self::$_registryClassName = $registryClassName; - } - - /** - * Unset the default registry instance. - * Primarily used in tearDown() in unit tests. - * @returns void - */ - public static function _unsetInstance() - { - self::$_registry = null; - } - - /** - * getter method, basically same as offsetGet(). - * - * This method can be called from an object of type Zend_Registry, or it - * can be called statically. In the latter case, it uses the default - * static instance stored in the class. - * - * @param string $index - get the value associated with $index - * @return mixed - * @throws Zend_Exception if no entry is registered for $index. - */ - public static function get($index) - { - $instance = self::getInstance(); - - if (!$instance->offsetExists($index)) { - trigger_error("No entry is registered for key '$index'"); - } - - return $instance->offsetGet($index); - } - - /** - * setter method, basically same as offsetSet(). - * - * This method can be called from an object of type Zend_Registry, or it - * can be called statically. In the latter case, it uses the default - * static instance stored in the class. - * - * @param string $index The location in the ArrayObject in which to store - * the value. - * @param mixed $value The object to store in the ArrayObject. - * @return void - */ - public static function set($index, $value) - { - $instance = self::getInstance(); - $instance->offsetSet($index, $value); - } - - /** - * Returns TRUE if the $index is a named value in the registry, - * or FALSE if $index was not found in the registry. - * - * @param string $index - * @return boolean - */ - public static function isRegistered($index) - { - if (self::$_registry === null) { - return false; - } - return self::$_registry->offsetExists($index); - } - - /** - * Constructs a parent ArrayObject with default - * ARRAY_AS_PROPS to allow access as an object - * - * @param array $array data array - * @param integer $flags ArrayObject flags - */ - public function __construct($array = array(), $flags = parent::ARRAY_AS_PROPS) - { - parent::__construct($array, $flags); - } - - /** - * @param string $index - * @return mixed - * - * Workaround for http://bugs.php.net/bug.php?id=40442 (ZF-960). - */ - public function offsetExists($index) - { - return array_key_exists($index, $this); - } - -} Copied: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Registry.php (from rev 10297, XoopsCore/branches/2.6.x/2.6.0/htdocs/class/registry.php) =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Registry.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Registry.php 2012-12-02 17:49:37 UTC (rev 10303) @@ -0,0 +1,206 @@ +<?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. +*/ + +/** + * Registry + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package class + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to li...@ze... so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Registry + * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Xoops_Registry extends ArrayObject +{ + /** + * Class name of the singleton registry object. + * @var string + */ + private static $_registryClassName = 'Xoops_Registry'; + + /** + * Registry object provides storage for shared objects. + * @var Xoops_Registry + */ + private static $_registry = null; + + /** + * Retrieves the default registry instance. + * + * @return Xoops_Registry + */ + public static function getInstance() + { + if (self::$_registry === null) { + self::init(); + } + + return self::$_registry; + } + + /** + * Set the default registry instance to a specified instance. + * + * @param Xoops_Registry $registry An object instance of type Xoops_Registry, + * or a subclass. + * @return void + */ + public static function setInstance(Xoops_Registry $registry) + { + if (self::$_registry !== null) { + trigger_error('Registry is already initialized'); + } + + self::setClassName(get_class($registry)); + self::$_registry = $registry; + } + + /** + * Initialize the default registry instance. + * + * @return void + */ + protected static function init() + { + self::setInstance(new self::$_registryClassName()); + } + + /** + * Set the class name to use for the default registry instance. + * Does not affect the currently initialized instance, it only applies + * for the next time you instantiate. + * + * @param string $registryClassName + * @return void + */ + public static function setClassName($registryClassName = 'Xoops_Registry') + { + if (self::$_registry !== null) { + trigger_error('Registry is already initialized'); + } + + if (!is_string($registryClassName)) { + trigger_error("Argument is not a class name"); + } + + self::$_registryClassName = $registryClassName; + } + + /** + * Unset the default registry instance. + * Primarily used in tearDown() in unit tests. + * @returns void + */ + public static function _unsetInstance() + { + self::$_registry = null; + } + + /** + * getter method, basically same as offsetGet(). + * + * This method can be called from an object of type Zend_Registry, or it + * can be called statically. In the latter case, it uses the default + * static instance stored in the class. + * + * @param string $index - get the value associated with $index + * @return mixed + */ + public static function get($index) + { + $instance = self::getInstance(); + + if (!$instance->offsetExists($index)) { + trigger_error("No entry is registered for key '$index'"); + } + + return $instance->offsetGet($index); + } + + /** + * setter method, basically same as offsetSet(). + * + * This method can be called from an object of type Zend_Registry, or it + * can be called statically. In the latter case, it uses the default + * static instance stored in the class. + * + * @param string $index The location in the ArrayObject in which to store + * the value. + * @param mixed $value The object to store in the ArrayObject. + * @return void + */ + public static function set($index, $value) + { + $instance = self::getInstance(); + $instance->offsetSet($index, $value); + } + + /** + * Returns TRUE if the $index is a named value in the registry, + * or FALSE if $index was not found in the r |
From: <tr...@us...> - 2012-12-02 17:33:41
|
Revision: 10302 http://sourceforge.net/p/xoops/svn/10302 Author: trabis Date: 2012-12-02 17:33:39 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Fixing theme to work with xlanguage Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_language.html Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_language.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_language.html 2012-12-02 17:32:55 UTC (rev 10301) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_language.html 2012-12-02 17:33:39 UTC (rev 10302) @@ -1,4 +1,4 @@ -<{if constant($smarty.const.XLANGUAGE_THEME_ENABLE)}> +<{if $smarty.const.XLANGUAGE_SWITCH_CODE}> <div class="pull-right"> <{$smarty.const.XLANGUAGE_SWITCH_CODE}> </div> |
From: <tr...@us...> - 2012-12-02 17:33:01
|
Revision: 10301 http://sourceforge.net/p/xoops/svn/10301 Author: trabis Date: 2012-12-02 17:32:55 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Updating/fixing xlanguage for 2.6 Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/footer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/menu.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/api.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/blocks/xlanguage_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/form/language.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/xlanguage.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/autoload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/vars.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/about.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/about.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/about.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -19,6 +19,7 @@ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); $xoops->header(); $xoops->theme->addStylesheet('modules/xcontact/css/moduladmin.css'); @@ -26,5 +27,4 @@ $admin_page->renderNavigation('about.php'); $admin_page->renderAbout(); -$xoops->footer(); -?> \ No newline at end of file +$xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/footer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/footer.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/footer.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -17,6 +17,6 @@ * @version $Id$ */ +$xoops = Xoops::getInstance(); $admin_page->renderIndex(); -$xoops->footer(); -?> \ No newline at end of file +$xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/header.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/header.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/header.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -1,7 +1,6 @@ <?php /** * Xlanguage extension module - * * 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. @@ -20,13 +19,13 @@ include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; $op = ''; -if ( isset( $_POST ) ){ - foreach ( $_POST as $k => $v ) { +if (isset($_POST)) { + foreach ($_POST as $k => $v) { ${$k} = $v; } } -if ( isset( $_GET ) ){ - foreach ( $_GET as $k => $v ) { +if (isset($_GET)) { + foreach ($_GET as $k => $v) { ${$k} = $v; } } @@ -42,5 +41,4 @@ $xoops->header(); $xoops->theme->addStylesheet('modules/xlanguage/css/moduladmin.css'); -$admin_page = new XoopsModuleAdmin(); -?> \ No newline at end of file +$admin_page = new XoopsModuleAdmin(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/index.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/index.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -19,24 +19,25 @@ include dirname(__FILE__) . '/header.php'; +$xoops = Xoops::getInstance(); $xoops->header(); -switch ( $op ) { +switch ( $op ) { case 'save': - if ( !$GLOBALS['xoopsSecurity']->check() ) { - $xoops->redirect('index.php', 5, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + if ( !$xoops->security->check() ) { + $xoops->redirect('index.php', 5, implode(',', $xoops->security->getErrors())); } $xlanguage_id = $system->CleanVars($_POST, 'xlanguage_id', 0, 'int'); - if( isset($xlanguage_id) && $xlanguage_id > 0 ){ + if( isset($xlanguage_id) && $xlanguage_id > 0 ){ $lang = $xlanguage_handler->get($xlanguage_id); - } else { + } else { $lang = $xlanguage_handler->create(); } $lang->CleanVarsForDB(); - if ($xlanguage_handler->insert($lang)) { + if ($xlanguage_handler->insert($lang)) { $xlanguage_handler->createConfig(); $xoops->redirect('index.php', 5, _AM_XLANGUAGE_SAVED); } @@ -51,15 +52,15 @@ case 'edit': $xlanguage_id = $system->CleanVars($_REQUEST, 'xlanguage_id', 0, 'int'); - if( isset($xlanguage_id) && $xlanguage_id > 0 ){ - if ($lang = $xlanguage_handler->get($xlanguage_id) ) { + if( isset($xlanguage_id) && $xlanguage_id > 0 ){ + if ($lang = $xlanguage_handler->get($xlanguage_id) ) { $form = $xoops->getModuleForm($lang, 'language', 'xlanguage'); $admin_page->addInfoBox(_MI_XLANGUAGE_MODIFY); $admin_page->addInfoBoxLine( $form->render() ); - } else { - $xoops->redirect('index.php', 5); + } else { + $xoops->redirect('index.php', 5); } - } else { + } else { $xoops->redirect('index.php', 5); } break; @@ -67,16 +68,16 @@ case 'del': $xlanguage_id = $system->CleanVars($_REQUEST, 'xlanguage_id', 0, 'int'); if( isset($xlanguage_id) && $xlanguage_id > 0 ){ - if ($lang = $xlanguage_handler->get($xlanguage_id) ) { + if ($lang = $xlanguage_handler->get($xlanguage_id) ) { $delete = $system->CleanVars( $_POST, 'ok', 0, 'int' ); - if ($delete == 1) { - if ( !$GLOBALS['xoopsSecurity']->check() ) { + if ($delete == 1) { + if ( !$xoops->security->check() ) { $xoops->redirect('index.php', 5, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } $xlanguage_handler->delete($lang); $xlanguage_handler->createConfig(); $xoops->redirect('index.php', 5, _AM_XLANGUAGE_DELETED); - } else { + } else { ob_start(); $xoops->confirm(array('ok' => 1, 'xlanguage_id' => $xlanguage_id, 'op' => 'del'), $_SERVER['REQUEST_URI'], sprintf(_AM_XLANGUAGE_DELETE_CFM . "<br /><b><span style='color : Red'> %s </span></b><br /><br />", $lang->getVar('xlanguage_name'))); $confirm = '<div class="confirm">' . ob_get_contents() . '</div>'; @@ -84,10 +85,10 @@ $admin_page->addInfoBox(_MI_XLANGUAGE_DELETE); $admin_page->addInfoBoxLine($confirm); } - } else { + } else { $xoops->redirect('index.php', 5); } - } else { + } else { $xoops->redirect('index.php', 5); } break; @@ -104,4 +105,3 @@ break; } include dirname(__FILE__) . '/footer.php'; -?> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/menu.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/menu.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/menu.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -35,5 +35,4 @@ $cpt++; $adminmenu[$cpt]['title'] = _MI_XLANGUAGE_ABOUT; $adminmenu[$cpt]['link'] = 'admin/about.php'; -$adminmenu[$cpt]['icon'] = 'about.png'; -?> \ No newline at end of file +$adminmenu[$cpt]['icon'] = 'about.png'; \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/api.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/api.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/api.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -1,7 +1,6 @@ <?php /** * Xlanguage extension module - * * 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. @@ -17,17 +16,19 @@ * @version $Id$ */ -global $xoops, $xlanguage; +$xoops = Xoops::getInstance(); +$xlanguage = array(); + include_once XOOPS_ROOT_PATH . '/modules/xlanguage/include/vars.php'; include_once XOOPS_ROOT_PATH . '/modules/xlanguage/include/functions.php'; -$cookie_var = XLANGUAGE_LANG_TAG; +$cookie_var = $xoops->registry->get('XLANGUAGE_LANG_TAG'); $xlanguage['action'] = false; -if (!empty($_GET[XLANGUAGE_LANG_TAG])) { +if (!empty($_GET[$xoops->registry->get('XLANGUAGE_LANG_TAG')])) { $cookie_path = '/'; - setcookie($cookie_var, $_GET[XLANGUAGE_LANG_TAG], time()+3600*24*30, $cookie_path, '', 0); - $xlanguage['lang'] = $_GET[XLANGUAGE_LANG_TAG]; + setcookie($cookie_var, $_GET[$xoops->registry->get('XLANGUAGE_LANG_TAG')], time() + 3600 * 24 * 30, $cookie_path, '', 0); + $xlanguage['lang'] = $_GET[$xoops->registry->get('XLANGUAGE_LANG_TAG')]; } elseif (!empty($_COOKIE[$cookie_var])) { $xlanguage['lang'] = $_COOKIE[$cookie_var]; } elseif ($lang = xlanguage_detectLang()) { @@ -41,29 +42,29 @@ $lang = $xlanguage_handler->getByName($xlanguage['lang']); -if ( is_array($lang) && strcasecmp($lang['xlanguage_name'], $xoops->getConfig('language')) ) { +if (is_array($lang) && strcasecmp($lang['xlanguage_name'], $xoops->getConfig('language'))) { $xoops->setConfig('language', $lang['xlanguage_name']); - if ( $lang['xlanguage_charset'] ) { + if ($lang['xlanguage_charset']) { $xlanguage['charset'] = $lang['xlanguage_charset']; } - if ( $lang['xlanguage_code'] ) { + if ($lang['xlanguage_code']) { $xlanguage['code'] = $lang['xlanguage_code']; } } unset($lang); -$GLOBALS['xlanguage_handler'] = $xlanguage_handler; +$xoops->registry->set('XLANGUAGE_HANDLER', $xlanguage_handler); -if ( $xlanguage['action'] ) { +if ($xlanguage['action']) { //if(CONV_REQUEST && (!empty($_GET)||!empty($_POST))){ - if ( !empty($_POST) ) { + if (!empty($_POST)) { $in_charset = $xlanguage['charset']; $out_charset = $xlanguage['charset_base']; //$CONV_REQUEST_array=array('_GET', '_POST'); - $CONV_REQUEST_array=array('_POST'); - foreach ( $CONV_REQUEST_array as $HV ) { - if ( !empty(${$HV}) ) { + $CONV_REQUEST_array = array('_POST'); + foreach ($CONV_REQUEST_array as $HV) { + if (!empty(${$HV})) { ${$HV} = xlanguage_convert_encoding(${$HV}, $out_charset, $in_charset); } $GLOBALS['HTTP' . $HV . '_VARS'] = ${$HV}; @@ -74,11 +75,4 @@ ob_start('xlanguage_ml'); } -/* - * hardcoded scripts for language switching in theme html files - * - * see include/vars.php - */ - - -?> \ No newline at end of file +$xoops->registry->set('XLANGUAGE', $xlanguage); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/blocks/xlanguage_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/blocks/xlanguage_blocks.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/blocks/xlanguage_blocks.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -1,7 +1,6 @@ <?php /** * Xlanguage extension module - * * 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. @@ -17,57 +16,57 @@ * @version $Id$ */ - function b_xlanguage_select_show($options) -{ - global $xlanguage; - $xoops = Xoops::getInstance(); +{ + $xoops = Xoops::getInstance(); + $xlanguage = $xoops->registry->get('XLANGUAGE'); + $lang_tag = $xoops->registry->get('XLANGUAGE_LANG_TAG'); - $options[3] = $xoops->getModuleConfig('theme', 'xlanguage'); + $options[3] = $xoops->getModuleConfig('theme', 'xlanguage'); $block = array(); - $xlanguage_handler = $xoops->getModuleHandler('xlanguage', 'xlanguage'); - $xlanguage_handler->loadConfig(); + $xlanguage_handler = $xoops->getModuleHandler('xlanguage', 'xlanguage'); + $xlanguage_handler->loadConfig(); - if ( !is_array($xlanguage_handler->cached_config) || count($xlanguage_handler->cached_config)<1 ) { - return $block; + if (!is_array($xlanguage_handler->cached_config) || count($xlanguage_handler->cached_config) < 1) { + return $block; } - $QUERY_STRING_array = array_filter(explode('&',$xoops->getEnv('QUERY_STRING'))); - $QUERY_STRING_new = array(); - foreach ( $QUERY_STRING_array as $QUERY ) { - if ( substr($QUERY, 0, (strlen(XLANGUAGE_LANG_TAG)+1)) != XLANGUAGE_LANG_TAG . '=' ) { - $vals = explode('=', $QUERY); - foreach ( array_keys($vals) as $key ) { - if ( preg_match('/^a-z0-9$/i', $vals[$key]) ) { - $vals[$key] = urlencode($vals[$key]); - } - } - $QUERY_STRING_new[] = implode('=', $vals); - } - } + $QUERY_STRING_array = array_filter(explode('&', $xoops->getEnv('QUERY_STRING'))); + $QUERY_STRING_new = array(); + foreach ($QUERY_STRING_array as $QUERY) { + if (substr($QUERY, 0, (strlen($lang_tag) + 1)) != $lang_tag . '=') { + $vals = explode('=', $QUERY); + foreach (array_keys($vals) as $key) { + if (preg_match('/^a-z0-9$/i', $vals[$key])) { + $vals[$key] = urlencode($vals[$key]); + } + } + $QUERY_STRING_new[] = implode('=', $vals); + } + } - $block['display'] = $options[0]; - $block['delimitor'] = $options[1]; - $block['number'] = $options[2]; + $block['display'] = $options[0]; + $block['delimitor'] = $options[1]; + $block['number'] = $options[2]; - $block['selected'] = $xlanguage['lang']; + $block['selected'] = $xlanguage['lang']; - if ( $options[0] == 'images' || $options[0] == 'text' ) { - $query_string = htmlSpecialChars(implode('&', $QUERY_STRING_new)); - $query_string .= empty($query_string) ? '' : '&'; - } else { - $query_string = implode('&', array_map('htmlspecialchars', $QUERY_STRING_new)); - $query_string .= empty($query_string) ? '' : '&'; - } - $block['url'] = $xoops->getEnv('PHP_SELF') . '?' . $query_string . XLANGUAGE_LANG_TAG . '='; + if ($options[0] == 'images' || $options[0] == 'text') { + $query_string = htmlSpecialChars(implode('&', $QUERY_STRING_new)); + $query_string .= empty($query_string) ? '' : '&'; + } else { + $query_string = implode('&', array_map('htmlspecialchars', $QUERY_STRING_new)); + $query_string .= empty($query_string) ? '' : '&'; + } + $block['url'] = $xoops->getEnv('PHP_SELF') . '?' . $query_string . $lang_tag . '='; $block['languages'] = $xlanguage_handler->cached_config; - return $block; + return $block; } function b_xlanguage_select_edit($options) -{ +{ $block_form = new XoopsFormElementTray(' ', '<br />'); $tmp = new XoopsFormSelect(_MB_XLANGUAGE_DISPLAY_METHOD . ' : ', 'options[0]', $options[0]); @@ -78,9 +77,8 @@ $tmp->addOption('bootstrap', _MB_XLANGUAGE_DISPLAY_BOOTSTRAP); $block_form->addElement($tmp); - $block_form->addElement(new XoopsFormText(_MB_XLANGUAGE_IMAGE_SEPARATOR . ' (' . _MB_XLANGUAGE_OPTIONAL . ') : ', 'options[1]', 5, 5, $options[1] )); - $block_form->addElement(new XoopsFormText(_MB_XLANGUAGE_IMAGE_PERROW . ' (' . _MB_XLANGUAGE_OPTIONAL . ') : ', 'options[2]', 2, 2, $options[2] )); + $block_form->addElement(new XoopsFormText(_MB_XLANGUAGE_IMAGE_SEPARATOR . ' (' . _MB_XLANGUAGE_OPTIONAL . ') : ', 'options[1]', 5, 5, $options[1])); + $block_form->addElement(new XoopsFormText(_MB_XLANGUAGE_IMAGE_PERROW . ' (' . _MB_XLANGUAGE_OPTIONAL . ') : ', 'options[2]', 2, 2, $options[2])); - return $block_form->render(); -} -?> \ No newline at end of file + return $block_form->render(); +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/form/language.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/form/language.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/form/language.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -1,7 +1,6 @@ <?php /** * Xlanguage module - * * 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. @@ -31,48 +30,48 @@ /** * Maintenance Form + * * @return void */ public function LanguageForm() - { + { $xoops = Xoops::getInstance(); parent::__construct('', 'xlanguage_form', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal'); // language name - $xlanguage_select = new XoopsFormSelect(_AM_XLANGUAGE_NAME, 'xlanguage_name', $this->xoopsObject->getVar('xlanguage_name')); + $xlanguage_select = new XoopsFormSelect(_AM_XLANGUAGE_NAME, 'xlanguage_name', $this->xoopsObject->getVar('xlanguage_name')); $xlanguage_select->addOptionArray(XoopsLists::getLangList()); $this->addElement($xlanguage_select, true); // language description - $this->addElement(new XoopsFormText(_AM_XLANGUAGE_DESCRIPTION, 'xlanguage_description', 5, 10, $this->xoopsObject->getVar('xlanguage_description') ), true); + $this->addElement(new XoopsFormText(_AM_XLANGUAGE_DESCRIPTION, 'xlanguage_description', 5, 10, $this->xoopsObject->getVar('xlanguage_description')), true); // language charset - $autoload = XoopsLoad::loadConfig( 'xlanguage' ); + $autoload = XoopsLoad::loadConfig('xlanguage'); $charset_select = new XoopsFormSelect(_AM_XLANGUAGE_CHARSET, 'xlanguage_charset', $this->xoopsObject->getVar('xlanguage_charset')); $charset_select->addOptionArray($autoload['charset']); $this->addElement($charset_select); // language code - $this->addElement(new XoopsFormText(_AM_XLANGUAGE_CODE, 'xlanguage_code', 5, 10, $this->xoopsObject->getVar('xlanguage_code') ), true); + $this->addElement(new XoopsFormText(_AM_XLANGUAGE_CODE, 'xlanguage_code', 5, 10, $this->xoopsObject->getVar('xlanguage_code')), true); // language weight - $this->addElement(new XoopsFormText(_AM_XLANGUAGE_WEIGHT, 'xlanguage_weight', 5, 10, $this->xoopsObject->getVar('xlanguage_weight') )); + $this->addElement(new XoopsFormText(_AM_XLANGUAGE_WEIGHT, 'xlanguage_weight', 5, 10, $this->xoopsObject->getVar('xlanguage_weight'))); - // language image $image_option_tray = new XoopsFormElementTray(_AM_XLANGUAGE_IMAGE, ''); $image_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/media/xoops/images/flags/' . $xoops->getModuleConfig('theme', 'xlanguage') . '/'); - $image_select = new XoopsFormSelect('', 'xlanguage_image', $this->xoopsObject->getVar('xlanguage_image')); + $image_select = new XoopsFormSelect('', 'xlanguage_image', $this->xoopsObject->getVar('xlanguage_image')); $image_select->addOptionArray($image_array); $image_select->setExtra("onchange='showImgSelected(\"image\", \"xlanguage_image\", \"/media/xoops/images/flags/" . $xoops->getModuleConfig('theme', 'xlanguage') . "/\", \"\", \"" . XOOPS_URL . "\")'"); $image_tray = new XoopsFormElementTray('', ' '); $image_tray->addElement($image_select); - $image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img style='width:24px; height:24px; ' src='" . XOOPS_URL . "/media/xoops/images/flags/" . $xoops->getModuleConfig('theme', 'xlanguage') . "/" . $this->xoopsObject->getVar("xlanguage_image") . "' name='image' id='image' alt='' /></div>")); + $image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img style='width:24px; height:24px; ' src='" . XOOPS_URL . "/media/xoops/images/flags/" . $xoops->getModuleConfig('theme', 'xlanguage') . "/" . $this->xoopsObject->getVar("xlanguage_image") . "' name='image' id='image' alt='' /></div>")); $image_option_tray->addElement($image_tray); $this->addElement($image_option_tray); - $this->addElement(new XoopsFormHidden('xlanguage_id', $this->xoopsObject->getVar('xlanguage_id') )); + $this->addElement(new XoopsFormHidden('xlanguage_id', $this->xoopsObject->getVar('xlanguage_id'))); $button_tray = new XoopsFormElementTray('', ''); $button_tray->addElement(new XoopsFormHidden('op', 'save')); @@ -86,7 +85,7 @@ } public function render() - { + { $this->LanguageForm(); ob_start(); parent::render(); @@ -94,5 +93,4 @@ ob_end_clean(); return $ret; } -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/xlanguage.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/xlanguage.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/xlanguage.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -1,7 +1,6 @@ <?php /** * Xlanguage extension module - * * 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. @@ -22,26 +21,21 @@ include_once XOOPS_ROOT_PATH . '/modules/xlanguage/include/vars.php'; class Xlanguage extends XoopsObject -{ +{ public function __construct() - { - $this->initVar('xlanguage_id' , XOBJ_DTYPE_INT , 0 , false, 10); - $this->initVar('xlanguage_name' , XOBJ_DTYPE_TXTBOX , '' , false); - $this->initVar('xlanguage_description' , XOBJ_DTYPE_TXTBOX , '' , false); - $this->initVar('xlanguage_code' , XOBJ_DTYPE_TXTBOX , '' , false); - $this->initVar('xlanguage_charset' , XOBJ_DTYPE_TXTBOX , '' , false); - $this->initVar('xlanguage_image' , XOBJ_DTYPE_TXTBOX , 'english.png' , false); - $this->initVar('xlanguage_weight' , XOBJ_DTYPE_INT , 1 , false, 10); - } - - public function Xlanguage() { - $this->__construct(); + $this->initVar('xlanguage_id', XOBJ_DTYPE_INT, 0, false, 10); + $this->initVar('xlanguage_name', XOBJ_DTYPE_TXTBOX, '', false); + $this->initVar('xlanguage_description', XOBJ_DTYPE_TXTBOX, '', false); + $this->initVar('xlanguage_code', XOBJ_DTYPE_TXTBOX, '', false); + $this->initVar('xlanguage_charset', XOBJ_DTYPE_TXTBOX, '', false); + $this->initVar('xlanguage_image', XOBJ_DTYPE_TXTBOX, 'english.png', false); + $this->initVar('xlanguage_weight', XOBJ_DTYPE_INT, 1, false, 10); } public function toArray() - { - global $xoops; + { + $xoops = Xoops::getInstance(); $ret = parent::toArray(); $ret['xlanguage_image'] = XOOPS_URL . '/media/xoops/images/flags/' . $xoops->getModuleConfig('theme', 'xlanguage') . '/' . $this->getVar('xlanguage_image'); return $ret; @@ -50,20 +44,20 @@ public function CleanVarsForDB() { global $system; - foreach ( $this->getValues() as $k => $v ) { - if ( $k != 'dohtml' ) { - if ( $this->vars[$k]['data_type'] == XOBJ_DTYPE_STIME || $this->vars[$k]['data_type'] == XOBJ_DTYPE_MTIME || $this->vars[$k]['data_type'] == XOBJ_DTYPE_LTIME) { + foreach ($this->getValues() as $k => $v) { + if ($k != 'dohtml') { + if ($this->vars[$k]['data_type'] == XOBJ_DTYPE_STIME || $this->vars[$k]['data_type'] == XOBJ_DTYPE_MTIME || $this->vars[$k]['data_type'] == XOBJ_DTYPE_LTIME) { $value = $system->CleanVars($_POST[$k], 'date', date('Y-m-d'), 'date') + $system->CleanVars($_POST[$k], 'time', date('u'), 'int'); - $this->setVar( $k, isset( $_POST[$k] ) ? $value : $v ); - } elseif ( $this->vars[$k]['data_type'] == XOBJ_DTYPE_INT ) { + $this->setVar($k, isset($_POST[$k]) ? $value : $v); + } elseif ($this->vars[$k]['data_type'] == XOBJ_DTYPE_INT) { $value = $system->CleanVars($_POST, $k, $v, 'int'); - $this->setVar( $k, $value ); - } elseif ( $this->vars[$k]['data_type'] == XOBJ_DTYPE_ARRAY ) { + $this->setVar($k, $value); + } elseif ($this->vars[$k]['data_type'] == XOBJ_DTYPE_ARRAY) { $value = $system->CleanVars($_POST, $k, $v, 'array'); - $this->setVar( $k, $value ); + $this->setVar($k, $value); } else { $value = $system->CleanVars($_POST, $k, $v, 'string'); - $this->setVar( $k, $value ); + $this->setVar($k, $value); } } } @@ -72,7 +66,6 @@ class XlanguageXlanguageHandler extends XoopsPersistableObjectHandler { - public function __construct(&$db) { parent::__construct($db, 'xlanguage', 'Xlanguage', 'xlanguage_id', 'xlanguage_name'); @@ -80,14 +73,15 @@ public function loadConfig() { + $xoops = Xoops::getInstance(); $this->configPath = XOOPS_VAR_PATH . '/configs/xlanguage/'; - $this->configFile = XLANGUAGE_CONFIG_FILE; + $this->configFile = $xoops->registry->get('XLANGUAGE_CONFIG_FILE'); $this->configFileExt = '.php'; $this->cached_config = $this->loadFileConfig(); } public function loadFileConfig() - { + { $cached_config = $this->readConfig(); if (empty($cached_config)) { $cached_config = $this->createConfig(); @@ -106,7 +100,7 @@ public function createConfig() { $cached_config = array(); - foreach ( $this->getAllLanguage( false ) as $key => $language ) { + foreach ($this->getAllLanguage(false) as $key => $language) { $cached_config[$language['xlanguage_name']] = $language; } $this->writeConfig($cached_config); @@ -115,28 +109,28 @@ public function writeConfig($data) { - if ($this->CreatePath($this->configPath) ) { + if ($this->CreatePath($this->configPath)) { $path_file = $this->configPath . $this->configFile . $this->configFileExt; XoopsLoad::load('XoopsFile'); $file = XoopsFile::getHandler('file', $path_file); - return $file->write( "return " . var_export($data, true) . ";"); + return $file->write("return " . var_export($data, true) . ";"); } } - private function CreatePath( $pathname, $pathout = XOOPS_ROOT_PATH ) + private function CreatePath($pathname, $pathout = XOOPS_ROOT_PATH) { $xoops = Xoops::getInstance(); - $pathname = substr( $pathname, strlen(XOOPS_ROOT_PATH) ); - $pathname = str_replace( DIRECTORY_SEPARATOR, '/', $pathname ); + $pathname = substr($pathname, strlen(XOOPS_ROOT_PATH)); + $pathname = str_replace(DIRECTORY_SEPARATOR, '/', $pathname); $dest = $pathout; - $paths = explode( '/', $pathname ); + $paths = explode('/', $pathname); - foreach ( $paths as $path ) { - if ( !empty( $path ) ) { + foreach ($paths as $path) { + if (!empty($path)) { $dest = $dest . '/' . $path; - if ( !is_dir( $dest ) ) { - if ( !mkdir( $dest , 0755 ) ) { + if (!is_dir($dest)) { + if (!mkdir($dest, 0755)) { return false; } else { $this->WriteIndex($xoops->path('uploads'), 'index.html', $dest); @@ -147,54 +141,51 @@ return true; } - private function WriteIndex( $folder_in, $source_file, $folder_out ) + private function WriteIndex($folder_in, $source_file, $folder_out) { - if ( !is_dir($folder_out) ) { - if ( !$this->CreatePath($folder_out) ) { + if (!is_dir($folder_out)) { + if (!$this->CreatePath($folder_out)) { return false; } } // Simple copy for a file - if ( is_file($folder_in . '/' . $source_file) ) { - return copy($folder_in . '/' . $source_file, $folder_out . '/' . basename($source_file) ); + if (is_file($folder_in . '/' . $source_file)) { + return copy($folder_in . '/' . $source_file, $folder_out . '/' . basename($source_file)); } return false; } - public function getByName($name = null) { - global $xoops; - $lang = empty($name) ? $xoops->getConfig('language') : strtolower($name); + $xoops = Xoops::getInstance(); + $name = empty($name) ? $xoops->getConfig('language') : strtolower($name); - $file_config = XLANGUAGE_CONFIG_FILE; - if ( !file_exists($file_config) || !isset($this->cached_config)) { + $file_config = $xoops->registry->get('XLANGUAGE_CONFIG_FILE'); + if (!file_exists($file_config) || !isset($this->cached_config)) { $this->loadConfig(); } - if ( isset($this->cached_config[$name]) ) { + if (isset($this->cached_config[$name])) { return $this->cached_config[$name]; } return null; } - - public function getAllLanguage( $asobject = true ) + public function getAllLanguage($asobject = true) { $criteria = new CriteriaCompo(); - $criteria->setSort( 'xlanguage_weight' ); - $criteria->setOrder( 'asc' ); + $criteria->setSort('xlanguage_weight'); + $criteria->setOrder('asc'); return parent::getAll($criteria, null, $asobject, true); } public function renderlist() { - global $xoops; - $xoops->tpl->assign('theme', $xoops->getModuleConfig('theme', 'xlanguage') ); - $xoops->tpl->assign('languages', $this->getAllLanguage(false) ); + $xoops = Xoops::getInstance(); + $xoops->tpl->assign('theme', $xoops->getModuleConfig('theme', 'xlanguage')); + $xoops->tpl->assign('languages', $this->getAllLanguage(false)); return $xoops->tpl->fetch('admin:xlanguage|xlanguage_admin_list.html'); } -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/autoload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/autoload.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/autoload.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -46,5 +46,4 @@ 'windows-1258' => 'windows-1258', 'windows-874' => 'windows-874' ), -); -?> \ No newline at end of file +); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/functions.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/functions.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -1,7 +1,6 @@ <?php /** * Xlanguage extension module - * * 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. @@ -17,10 +16,17 @@ * @version $Id$ */ +/** + * @param string|array $value + * @param string $out_charset + * @param string $in_charset + * + * @return array|string + */ function xlanguage_convert_encoding($value, $out_charset, $in_charset) { - if ( is_array($value) ) { - foreach ( $value as $key => $val ) { + if (is_array($value)) { + foreach ($value as $key => $val) { $value[$key] = xlanguage_convert_encoding($val, $out_charset, $in_charset); } } else { @@ -29,18 +35,26 @@ return $value; } +/** + * @param string $value + * @param string $out_charset + * @param string $in_charset + * + * @return string + */ function xlanguage_convert_item($value, $out_charset, $in_charset) { - if ( strtolower($in_charset) == strtolower($out_charset) ) { + $xoops = Xoops::getInstance(); + if (strtolower($in_charset) == strtolower($out_charset)) { return $value; } - $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true); - if ( is_object($xconv_handler) && $converted_value = @$xconv_handler->convert_encoding($value, $out_charset, $in_charset) ) { + $xconv_handler = $xoops->getModuleHandler('xconv', 'xconv', true); + if (is_object($xconv_handler) && $converted_value = @$xconv_handler->convert_encoding($value, $out_charset, $in_charset)) { return $converted_value; } - if ( XOOPS_USE_MULTIBYTES && function_exists('mb_convert_encoding') ) { + if (XOOPS_USE_MULTIBYTES && function_exists('mb_convert_encoding')) { $converted_value = @mb_convert_encoding($value, $out_charset, $in_charset); - } elseif ( function_exists('iconv') ) { + } elseif (function_exists('iconv')) { $converted_value = @iconv($in_charset, $out_charset, $value); } $value = empty($converted_value) ? $value : $converted_value; @@ -52,74 +66,84 @@ * Analyzes some PHP environment variables to find the most probable language * that should be used * - * @param string $ string to analyze - * @param integer $ type of the PHP environment variable which value is $str - * @global array the list of available translations - * @global string the retained translation keyword - * @access private + * @param string $str string to analyze + * @param integer $envType type of the PHP environment variable which value is $str + * + * @return int|string */ -function xlanguage_lang_detect($str = '', $envType = '') +function xlanguage_lang_detect($str = '', $envType = 0) { - foreach ( $GLOBALS['available_languages'] AS $key => $value ) { + $xoops = Xoops::getInstance(); + $lang = 'en'; + foreach ($xoops->registry->get('XLANGUAGE_AVAILABLE_LANGUAGES') as $key => $value) { // $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable, // 2 for the 'HTTP_USER_AGENT' one $expr = $value[0]; - if ( strpos($expr, '[-_]') === FALSE ) { + if (strpos($expr, '[-_]') === FALSE) { $expr = str_replace('|', '([-_][[:alpha:]]{2,3})?|', $expr); } - if ( ($envType == 1 && preg_match('^(' . $expr . ')(;q=[0-9]\\.[0-9])?$^', $str) ) || ($envType == 2 && preg_match('(\(|\[|;[[:space:]])(' . $expr . ')(;|\]|\))', $str))) { - $lang = $key; - //if ( $lang != 'en' ) + if (($envType == 1 && preg_match('^(' . $expr . ')(;q=[0-9]\\.[0-9])?$^', $str)) || ($envType == 2 && preg_match('(\(|\[|;[[:space:]])(' . $expr . ')(;|\]|\))', $str))) { + $lang = $key; break; } } return $lang; } +/** + * @return string + */ function xlanguage_detectLang() { - global $available_languages,$_SERVER; + $xoops = Xoops::getInstance(); - if ( !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ) { + if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE']; } - if ( !empty($_SERVER['HTTP_USER_AGENT']) ) { + if (!empty($_SERVER['HTTP_USER_AGENT'])) { $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; } $lang = ''; - $xoops_lang =''; + $xoops_lang = ''; // 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE // variable - if ( empty($lang) && !empty($HTTP_ACCEPT_LANGUAGE) ) { + if (empty($lang) && !empty($HTTP_ACCEPT_LANGUAGE)) { $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); $acceptedCnt = count($accepted); reset($accepted); for ($i = 0; $i < $acceptedCnt; $i++) { $lang = xlanguage_lang_detect($accepted[$i], 1); - if ( strncasecmp($lang,'en',2) ) { + if (strncasecmp($lang, 'en', 2)) { break; } } } // 2. try to findout user's language by checking its HTTP_USER_AGENT variable - if ( empty($lang) && !empty($HTTP_USER_AGENT) ) { + if (empty($lang) && !empty($HTTP_USER_AGENT)) { $lang = xlanguage_lang_detect($HTTP_USER_AGENT, 2); } // 3. If we catch a valid language, configure it - if ( !empty($lang) ) { - $xoops_lang = $available_languages[$lang][1]; + if (!empty($lang)) { + $available = $xoops->registry->get('XLANGUAGE_AVAILABLE_LANGUAGES'); + $xoops_lang = $available[$lang][1]; } return $xoops_lang; } +/** + * @param string $output + * + * @return array|mixed|string + */ function xlanguage_encoding($output) { - global $xlanguage; + $xoops = Xoops::getInstance(); + $xlanguage = $xoops->registry->get('XLANGUAGE'); $output = xlanguage_ml($output); // escape XML doc - if ( preg_match("/^\<\?[\s]?xml[\s]+version=([\"'])[^\>]+\\1[\s]+encoding=([\"'])[^\>]+\\2[\s]?\?\>/i", $output) ) { + if (preg_match("/^\<\?[\s]?xml[\s]+version=([\"'])[^\>]+\\1[\s]+encoding=([\"'])[^\>]+\\2[\s]?\?\>/i", $output)) { return $output; } $in_charset = $xlanguage['charset_base']; @@ -128,22 +152,32 @@ return $output = xlanguage_convert_encoding($output, $out_charset, $in_charset); } +/** + * @param string $s + * + * @return mixed + */ function xlanguage_ml($s) { - global $xoops, $xlanguage_langs; - if ( !is_object($xoops) ) { - $xoops = Xoops::getInstance(); + static $xlanguage_langs; + + $xoops = Xoops::getInstance(); + $xlanguage_handler = $xoops->registry->get('XLANGUAGE_HANDLER'); + + if (!is_object($xoops)) { + $xoops = Xoops::getInstance(); } $xoopsConfigLanguage = $xoops->getConfig('language'); - if ( !isset($xlanguage_langs) ) { - $langs = $GLOBALS['xlanguage_handler']->cached_config; - foreach ( array_keys($langs) as $_lang ) { + if (!isset($xlanguage_langs)) { + $langs = $xlanguage_handler->cached_config; + foreach (array_keys($langs) as $_lang) { $xlanguage_langs[$_lang] = $langs[$_lang]['xlanguage_code']; } unset($langs); } - if ( empty($xlanguage_langs) || count($xlanguage_langs) ==0) { + $xoops->registry->set('XLANGUAGE_LANGS', $xlanguage_langs); + if (empty($xlanguage_langs) || count($xlanguage_langs) == 0) { return $s; } @@ -156,70 +190,75 @@ // escape brackets inside of <textarea></textarea> $patterns[] = "/(\<textarea\b[^>]*>[^\<]*\<\/textarea>)/isU"; - $s = preg_replace_callback( $patterns , 'xlanguage_ml_escape_bracket' , $s ) ; + $s = preg_replace_callback($patterns, 'xlanguage_ml_escape_bracket', $s); // create the pattern between language tags - $pqhtmltags = explode( ',' , preg_quote( XLANGUAGE_TAGS_RESERVED , '/' ) ) ; - $mid_pattern = '(?:(?!(' . implode( '|' , $pqhtmltags ) . ')).)*' ; + $pqhtmltags = explode(',', preg_quote($xoops->registry->get('XLANGUAGE_TAGS_RESERVED'), '/')); + $mid_pattern = '(?:(?!(' . implode('|', $pqhtmltags) . ')).)*'; $patterns = array(); $replaces = array(); /* */ - if ( isset($xlanguage_langs[$xoopsConfigLanguage]) ) { + if (isset($xlanguage_langs[$xoopsConfigLanguage])) { $lang = $xlanguage_langs[$xoopsConfigLanguage]; $patterns[] = '/(\[([^\]]*\|)?' . preg_quote($lang) . '(\|[^\]]*)?\])(' . $mid_pattern . ')(\[\/([^\]]*\|)?' . preg_quote($lang) . '(\|[^\]]*)?\])/isU'; $replaces[] = '$4'; } /* */ - foreach ( array_keys($xlanguage_langs) as $_lang ) { - if ( $_lang == $xoopsConfigLanguage ) { + foreach (array_keys($xlanguage_langs) as $_lang) { + if ($_lang == $xoopsConfigLanguage) { continue; } $name = $xlanguage_langs[$_lang]; $patterns[] = '/(\[([^\]]*\|)?' . preg_quote($name) . '(\|[^\]]*)?\])(' . $mid_pattern . ')(\[\/([^\]]*\|)?' . preg_quote($name) . '(\|[^\]]*)?(\]\<br[\s]?[\/]?\>|\]))/isU'; $replaces[] = ''; } - if ( !empty($xoopsConfigLanguage) ) { - $s = preg_replace( '/\[[\/]?[\|]?' . preg_quote($xoopsConfigLanguage) . '[\|]?\](\<br \/\>)?/i' , '' , $s ) ; + if (!empty($xoopsConfigLanguage)) { + $s = preg_replace('/\[[\/]?[\|]?' . preg_quote($xoopsConfigLanguage) . '[\|]?\](\<br \/\>)?/i', '', $s); } - if ( count($replaces)>0 ) { - $s = preg_replace( $patterns , $replaces , $s ) ; + if (count($replaces) > 0) { + $s = preg_replace($patterns, $replaces, $s); } - return $s ; + return $s; } -function xlanguage_ml_escape_bracket( $matches ) +/** + * @param array $matches + * + * @return mixed + */ +function xlanguage_ml_escape_bracket($matches) { - global $xlanguage_langs; + $xoops = Xoops::getInstance(); + $xlanguage_langs = $xoops->registry->get('XLANGUAGE_LANGS'); + $ret = $matches[1]; - if ( !empty($xlanguage_langs) ) { - $pattern = '/(\[([\/])?(' . implode('|',array_map('preg_quote', array_values($xlanguage_langs))) . ')([\|\]]))/isU'; + if (!empty($xlanguage_langs)) { + $pattern = '/(\[([\/])?(' . implode('|', array_map('preg_quote', array_values($xlanguage_langs))) . ')([\|\]]))/isU'; $ret = preg_replace($pattern, '[\\2\\3\\4', $ret); } return $ret; } - function xlanguage_select_show($options = null) { - global $xoops; - if ( !constant(XLANGUAGE_THEME_ENABLE) ) { + $xoops = Xoops::getInstance(); + if (!$xoops->registry->get('XLANGUAGE_THEME_ENABLE')) { + define('XLANGUAGE_SWITCH_CODE', false); return false; } - include_once XOOPS_ROOT_PATH . '/modules/xlanguage/blocks/xlanguage_blocks.php'; - if ( empty($options) ) { - $options[0] = 'images'; // display style: image, text, select - $options[1] = ' '; // delimitor - $options[2] = 5; // items per line + if (empty($options)) { + $options[0] = 'images'; // display style: image, text, select + $options[1] = ' '; // delimitor + $options[2] = 5; // items per line } $block = b_xlanguage_select_show($options); $xoops->theme->addStylesheet('modules/xlanguage/css/block.css'); - $xoops->tpl->assign('block', $block ); + $xoops->tpl->assign('block', $block); $xlanguage_switch_code = "<div id='xo-language' class='" . $options[0] . "'>" . $xoops->tpl->fetch('db:xlanguage_block.html') . "</div>"; - define('XLANGUAGE_SWITCH_CODE', $xlanguage_switch_code); + define('XLANGUAGE_SWITCH_CODE',$xlanguage_switch_code); return true; -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/vars.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/vars.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/vars.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -1,7 +1,6 @@ <?php /** * Xlanguage extension module - * * 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. @@ -17,34 +16,13 @@ * @version $Id$ */ -if ( !defined('XLANGUAGE_CONFIG_FILE') ) { - define('XLANGUAGE_CONFIG_FILE', 'xlanguage'); -} -if ( !defined('XLANGUAGE_LANG_TAG') ) { - define('XLANGUAGE_LANG_TAG', 'lang'); -} -if ( !defined('XLANGUAGE_TAGS_RESERVED') ) { - define('XLANGUAGE_TAGS_RESERVED', '</head>,</body>'); -} +$xoops = Xoops::getInstance(); +$xoops->registry->set('XLANGUAGE_CONFIG_FILE', 'xlanguage'); +$xoops->registry->set('XLANGUAGE_LANG_TAG', 'lang'); +$xoops->registry->set('XLANGUAGE_TAGS_RESERVED', '</head>,</body>'); +$xoops->registry->set('XLANGUAGE_THEME_ENABLE', true); +$xoops->registry->set('XLANGUAGE_THEME_OPTIONS', 'bootstrap| |5'); // display mode, delimitor, number per line -/* - * hardcoded scripts for language switching in theme html files - * - * To use it: - * 1 set '$xlanguage_theme_enable = true;' - * 2 config options "$options = array('images', ' ', 5); // display mode, delimitor, number per line"; Options for display mode: image - flag; text - text; dropdown - dropdown selection box with text - * 3 insert "<{$smarty.const.XLANGUAGE_SWITCH_CODE}>" into your theme html anywhere you would like to see it present - */ - -if ( !defined('XLANGUAGE_THEME_ENABLE') ) { - define('XLANGUAGE_THEME_ENABLE', 'true'); -} - -if ( !defined('XLANGUAGE_THEME_OPTIONS') ) { - define('XLANGUAGE_THEME_OPTIONS', 'bootstrap| |5' ); // display mode, delimitor, number per line -} - - /** * phpMyAdmin Language Loading File */ @@ -67,54 +45,33 @@ * without the '.php' extension. * 4. The last values associated to the key is the language code as defined by * the RFC1766. - * * Beware that the sorting order (first values associated to keys by * alphabetical reverse order in the array) is important: 'zh-tw' (chinese * traditional) must be detected before 'zh' (chinese simplified) for * example. - * * When there are more than one charset for a language, we put the -utf-8 * first. */ -$GLOBALS['available_languages'] = array( - 'ar' => array('ar([-_][[:alpha:]]{2})?|arabic', 'arabic'), - 'bg' => array('bg|bulgarian', 'bulgarian'), - 'ca' => array('ca|catalan', 'catalan'), - 'cs' => array('cs|czech', 'czech'), - 'da' => array('da|danish', 'danish'), - 'de' => array('de([-_][[:alpha:]]{2})?|german', 'german'), - 'el' => array('el|greek', 'greek'), - 'en' => array('en([-_][[:alpha:]]{2})?|english', 'english'), - 'es' => array('es([-_][[:alpha:]]{2})?|spanish', 'spanish'), - 'et' => array('et|estonian', 'estonian'), - 'fi' => array('fi|finnish', 'finnish'), - 'fr' => array('fr([-_][[:alpha:]]{2})?|french', 'french'), - 'gl' => array('gl|galician', 'galician'), - 'he' => array('he|hebrew', 'hebrew'), - 'hr' => array('hr|croatian', 'croatian'), - 'hu' => array('hu|hungarian', 'hungarian'), - 'id' => array('id|indonesian', 'indonesian'), - 'it' => array('it|italian', 'italian'), - 'ja' => array('ja|japanese', 'japanese'), - 'ko' => array('ko|korean', 'koreano'), - 'ka' => array('ka|georgian', 'georgian'), - 'lt' => array('lt|lithuanian', 'lithuanian'), - 'lv' => array('lv|latvian', 'latvian'), - 'nl' => array('nl([-_][[:alpha:]]{2})?|dutch', 'dutch'), - 'no' => array('no|norwegian', 'norwegian'), - 'pl' => array('pl|polish', 'polish'), - 'pt-br' => array('pt[-_]br|brazilian portuguese', 'portuguesebr'), - 'pt' => array('pt([-_][[:alpha:]]{2})?|portuguese', 'portuguese'), - 'ro' => array('ro|romanian', 'romanian'), - 'ru' => array('ru|russian', 'russian'), - 'sk' => array('sk|slovak', 'slovak'), - 'sq' => array('sq|albanian', 'albanian'), - 'sr' => array('sr|serbian', 'serbian'), - 'sv' => array('sv|swedish', 'swedish'), - 'th' => array('th|thai', 'thai'), - 'tr' => array('tr|turkish', 'turkish'), - 'uk' => array('uk|ukrainian', 'ukrainian'), - 'zh-tw' => array('zh[-_]tw|chinese traditional', 'tchinese'), - 'zh-cn' => array('zh[-_]cn|chinese simplified', 'schinese'), - ); -?> \ No newline at end of file +$xoops->registry->set('XLANGUAGE_AVAILABLE_LANGUAGES', array( + 'ar' => array('ar([-_][[:alpha:]]{2})?|arabic', 'arabic'), 'bg' => array('bg|bulgarian', 'bulgarian'), + 'ca' => array('ca|catalan', 'catalan'), 'cs' => array('cs|czech', 'czech'), + 'da' => array('da|danish', 'danish'), 'de' => array('de([-_][[:alpha:]]{2})?|german', 'german'), + 'el' => array('el|greek', 'greek'), 'en' => array('en([-_][[:alpha:]]{2})?|english', 'english'), + 'es' => array('es([-_][[:alpha:]]{2})?|spanish', 'spanish'), 'et' => array('et|estonian', 'estonian'), + 'fi' => array('fi|finnish', 'finnish'), 'fr' => array('fr([-_][[:alpha:]]{2})?|french', 'french'), + 'gl' => array('gl|galician', 'galician'), 'he' => array('he|hebrew', 'hebrew'), + 'hr' => array('hr|croatian', 'croatian'), 'hu' => array('hu|hungarian', 'hungarian'), + 'id' => array('id|indonesian', 'indonesian'), 'it' => array('it|italian', 'italian'), + 'ja' => array('ja|japanese', 'japanese'), 'ko' => array('ko|korean', 'koreano'), + 'ka' => array('ka|georgian', 'georgian'), 'lt' => array('lt|lithuanian', 'lithuanian'), + 'lv' => array('lv|latvian', 'latvian'), 'nl' => array('nl([-_][[:alpha:]]{2})?|dutch', 'dutch'), + 'no' => array('no|norwegian', 'norwegian'), 'pl' => array('pl|polish', 'polish'), + 'pt-br' => array('pt[-_]br|brazilian portuguese', 'portuguesebr'), + 'pt' => array('pt([-_][[:alpha:]]{2})?|portuguese', 'portuguese'), 'ro' => array('ro|romanian', 'romanian'), + 'ru' => array('ru|russian', 'russian'), 'sk' => array('sk|slovak', 'slovak'), + 'sq' => array('sq|albanian', 'albanian'), 'sr' => array('sr|serbian', 'serbian'), + 'sv' => array('sv|swedish', 'swedish'), 'th' => array('th|thai', 'thai'), + 'tr' => array('tr|turkish', 'turkish'), 'uk' => array('uk|ukrainian', 'ukrainian'), + 'zh-tw' => array('zh[-_]tw|chinese traditional', 'tchinese'), + 'zh-cn' => array('zh[-_]cn|chinese simplified', 'schinese'), + )); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php 2012-12-02 16:23:25 UTC (rev 10300) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php 2012-12-02 17:32:55 UTC (rev 10301) @@ -1,7 +1,6 @@ <?php /** * Xlanguage extension module - * * 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. @@ -19,7 +18,6 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); - /** * Xlanguage core preloads * @@ -28,29 +26,26 @@ * @author trabis <lus...@gm...> */ class XlanguageCorePreload extends XoopsPreloadItem -{ - static public function eventCoreLanguageCommon($args) - { - if (XlanguageCorePreload::isActive()) { - include_once dirname(dirname(__FILE__)) . '/api.php'; - } +{ + /** + * @param array $args + */ + static public function eventCoreHeaderStart($args) + { + include_once dirname(dirname(__FILE__)) . '/api.php'; + include_once dirname(dirname(__FILE__)) . '/include/vars.php'; + include_once dirname(dirname(__FILE__)) . '/include/functions.php'; } - static public function eventCoreHeaderCommon($args) - { + /** + * @param array $args + */ + static public function eventCoreHeaderEnd($args) + { + $xoops = Xoops::getInstance(); + include_once dirname(dirname(__FILE__)) . '/api.php'; include_once dirname(dirname(__FILE__)) . '/include/vars.php'; include_once dirname(dirname(__FILE__)) . '/include/functions.php'; - if (XlanguageCorePreload::isActive() && defined('XLANGUAGE_THEME_ENABLE') && constant('XLANGUAGE_THEME_ENABLE') ) { - xlanguage_select_show( explode('|', XLANGUAGE_THEME_OPTIONS) ); - } + xlanguage_select_show(explode('|', $xoops->registry->get('XLANGUAGE_THEME_OPTIONS'))); } - - static private function isActive() - { - global $xoops; - $module_handler = $xoops->getHandlerModule(); - $module = $module_handler->getByDirname('xlanguage'); - return ($module && $module->getVar('isactive')) ? true : false; - } -} -?> +} \ No newline at end of file |
From: <ma...@us...> - 2012-12-02 16:23:27
|
Revision: 10300 http://sourceforge.net/p/xoops/svn/10300 Author: mageg Date: 2012-12-02 16:23:25 +0000 (Sun, 02 Dec 2012) Log Message: ----------- little error in moduleadmin Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-12-02 16:21:02 UTC (rev 10299) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-12-02 16:23:25 UTC (rev 10300) @@ -139,7 +139,7 @@ $text = $value; $type = 'error'; } - if ($xoops->isActiveModule($value) == false) { + if ($xoops->isActiveModule($text) == false) { $this->_itemConfigBoxLine[] = array('type' => $type, 'text' => sprintf(_AM_MODULEADMIN_CONFIG_EXTENSIONKO, $text)); } else { $this->_itemConfigBoxLine[] = array('type' => 'accept', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_EXTENSIONOK, $text)); @@ -155,7 +155,7 @@ $text = $value; $type = 'error'; } - if ($xoops->isActiveModule($value) == false) { + if ($xoops->isActiveModule($text) == false) { $this->_itemConfigBoxLine[] = array('type' => $type, 'text' => sprintf(_AM_MODULEADMIN_CONFIG_MODULEKO, $text)); } else { $this->_itemConfigBoxLine[] = array('type' => 'accept', 'text' => sprintf(_AM_MODULEADMIN_CONFIG_MODULEOK, $text)); |
From: <ma...@us...> - 2012-12-02 16:21:04
|
Revision: 10299 http://sourceforge.net/p/xoops/svn/10299 Author: mageg Date: 2012-12-02 16:21:02 +0000 (Sun, 02 Dec 2012) Log Message: ----------- add printer page in page module Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/css/styles.css XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/language/english/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_viewpage.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/xoops_version.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/print.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_print.html Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/css/styles.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/css/styles.css 2012-12-02 15:44:57 UTC (rev 10298) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/css/styles.css 2012-12-02 16:21:02 UTC (rev 10299) @@ -87,4 +87,21 @@ padding-top: 5px; } +#page-print { + width: 640px; + border: 1px solid #575757; + padding: 10px; + margin: 2px +} +#page-logo-print { + text-align: center; + margin: 20px; +} + +#page-footer-print { + width: 640px; + padding: 1px; + text-align: center; + margin: 20px 2px 20px 2px; +} Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/language/english/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/language/english/main.php 2012-12-02 15:44:57 UTC (rev 10298) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/language/english/main.php 2012-12-02 16:21:02 UTC (rev 10299) @@ -34,9 +34,15 @@ define("_MD_PAGE_VIEWPAGE_RATING","Rating"); define("_MD_PAGE_VIEWPAGE_VOTE","votes"); define("_MD_PAGE_VIEWPAGE_SUMMARY","Summary"); +define("_MD_PAGE_VIEWPAGE_PRINT","Printer page"); // rating.php define("_MD_PAGE_RATING_DONOTVOTE","Do not vote for your own files."); define("_MD_PAGE_RATING_VOTEONCE","Please do not vote for the same resource more than once."); define("_MD_PAGE_RATING_CONFIRM","Are you sure you want to give the note %s for page '%s'?"); -define("_MD_PAGE_RATING_THANKS","Thank you for your vote"); \ No newline at end of file +define("_MD_PAGE_RATING_THANKS","Thank you for your vote"); + +// print.php +define("_MD_PAGE_PRINT","Print"); +define("_MD_PAGE_PRINT_COMES","This article comes from"); +define("_MD_PAGE_PRINT_URL","The URL for this page is: "); \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/print.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/print.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/print.php 2012-12-02 16:21:02 UTC (rev 10299) @@ -0,0 +1,96 @@ +<?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. +*/ + +/** + * page module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package page + * @since 2.6.0 + * @author Mage Gr\xE9gory (AKA Mage) + * @version $Id$ + */ + +include_once 'header.php'; +$tpl = new XoopsTpl(); + +// Get ID +$content_id = $system->cleanVars($_REQUEST, 'id', 0, 'int'); +// Get handler +$content_Handler = $xoops->getModuleHandler('page_content'); +$related_Handler = $xoops->getModuleHandler('page_related'); + +$view_content = $content_Handler->get($content_id); + +// Test if the page exist +if (count($view_content) == 0 || $view_content->getVar('content_status') == 0){ + $xoops->redirect('index.php', 3, _MD_PAGE_VIEWPAGE_NOPAGE); + exit(); +} + +// Permission to view +$perm_view = ($gperm_handler->checkRight('page_view_item', $content_id, $groups, $xoopsModule->getVar('mid'), false)) ? true : false ; +if(!$perm_view || $view_content->getVar('content_doprint') == false) { + $xoops->redirect("javascript:history.go(-1)", 2, _NOPERM); + exit(); +} + +$tpl->assign('content_id' , $content_id); +$tpl->assign('content_title' , $view_content->getVar('content_title')); +$tpl->assign('content_shorttext' , $view_content->getVar('content_shorttext')); +$tpl->assign('content_text' , $view_content->getVar('content_text')); +$tpl->assign('content_author' , XoopsUser::getUnameFromId($view_content->getVar('content_author'))); +$tpl->assign('content_authorid' , $view_content->getVar('content_author')); +$tpl->assign('content_hits' , sprintf(_MD_PAGE_VIEWPAGE_HITS, $view_content->getVar('content_hits'))); +$tpl->assign('content_date' , XoopsLocal::formatTimestamp($view_content->getVar('content_create'), $xoops->getModuleConfig('page_dateformat'))); +$tpl->assign('content_time' , XoopsLocal::formatTimestamp($view_content->getVar('content_create'), $xoops->getModuleConfig('page_timeformat'))); +$tpl->assign('content_comments' , $view_content->getVar('content_comments')); +$tpl->assign('content_rating' , number_format($view_content->getVar('content_rating'), 1)); +$tpl->assign('content_votes' , $view_content->getVar('content_votes')); +$tpl->assign('content_doauthor', $view_content->getVar('content_doauthor')); +$tpl->assign('content_dodate', $view_content->getVar('content_dodate')); +$tpl->assign('content_domail', $view_content->getVar('content_domail')); +$tpl->assign('content_dohits', $view_content->getVar('content_dohits')); +$tpl->assign('content_dorating', $view_content->getVar('content_dorating')); +$tpl->assign('content_dotitle', $view_content->getVar('content_dotitle')); +if ($view_content->getVar('content_docoms') == false){ + $ncoms = false; +} elseif ($view_content->getVar('content_doncoms') == false){ + $ncoms = false; +} else { + $ncoms = true; +} +$tpl->assign('content_doncoms', $ncoms); +if ($view_content->getVar('content_dotitle') == false && $view_content->getVar('content_dorating') == false) { + $header = false; +} else { + $header = true; +} +$tpl->assign('content_doheader', $header); +if ($view_content->getVar('content_doauthor') == false && $view_content->getVar('content_dodate') == false && $view_content->getVar('content_dohits') == false && $ncoms == false) { + $footer = false; +} else { + $footer = true; +} +$tpl->assign('content_dofooter', $footer); + +$page = new Page(); + +$related = $page->menu_related($content_id); + +if ($related['domenu'] ) { + $tpl->assign('summary', $related['summary']); +} +$tpl->assign('xoops_sitename', $xoops->getConfig('sitename')); +// Meta +$tpl->assign('xoops_pagetitle', strip_tags($view_content->getVar('content_title') . ' - ' . _MD_PAGE_PRINT . ' - ' . $xoopsModule->name())); +$tpl->display(dirname(__FILE__) . '/templates/page_print.html'); \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/print.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_print.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_print.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_print.html 2012-12-02 16:21:02 UTC (rev 10299) @@ -0,0 +1,91 @@ +<!DOCTYPE html> +<html lang="<{$xoops_langcode}>"> +<head> + <!-- Title and meta --> + <meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" /> + <title><{$xoops_pagetitle}> - <{$xoops_sitename}></title> + <meta name="robots" content="noindex,nofollow" /> + + <meta name="generator" content="XOOPS" /> + + <!-- Xoops style sheet --> + <link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl xoops.css}>" /> + <link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl media/xoops/css/icons.css}>" /> + <link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl media/bootstrap/css/bootstrap.min.css}>" /> + <link rel="stylesheet" type="text/css" media="screen" href="<{xoImgUrl media/bootstrap/css/xoops.bootstrap.css}>" /> + <link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/modules/page/css/styles.css" /> + <!--<link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl media/bootstrap/css/bootstrap-responsive.min.css}>" />--> + <!-- Theme style sheet --> + <link rel="stylesheet" type="text/css" media="screen" href="<{xoImgUrl css/style.css}>" /> + <!--[if lte IE 8]> + <link rel="stylesheet" href="<{xoImgUrl styleIE8.css}>" type="text/css" /> + <![endif]--> + + <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + +</head> +<!--<body class="<{$xoops_langcode}>" onload="window.print()">--> +<body class="<{$xoops_langcode}>"> + <div id="page-print"> + <div id="page-logo-print"> + <img src="<{$xoops_url}>/images/logo.png" alt="<{$xoops_sitename}>" /> + </div> + <{if $content_doheader}> + <div class="page_header"> + + <{if $content_dotitle}> + <div class="page_headerleft"> + <{$content_title}> + </div> + <{/if}> + </div> + <{if $content_dorating}> + <div class="page_vote"> + <{$smarty.const._MD_PAGE_VIEWPAGE_RATING}>: <{$content_rating}> (<{$content_votes}> <{$smarty.const._MD_PAGE_VIEWPAGE_VOTE}>) + </div> + <{/if}> + <{/if}> + <div class="page_content"> + <{if $summary}> + <h4><{$smarty.const._MD_PAGE_VIEWPAGE_SUMMARY}>:</h4> + <div> + <ul> + <{foreach item=summary from=$summary}> + <li><{$summary}></li> + <{/foreach}> + </ul> + </div> + <{/if}> + <{$content_shorttext}> + <br /> + <{$content_text}> + </div> + <{if $content_dofooter}> + <div class="page_footer"> + + <div class="page_footerleft"> + <{if $content_doauthor}><{$smarty.const._MD_PAGE_VIEWPAGE_POSTEDBY}> <a href="<{$xoops_url}>/userinfo.php?uid=<{$content_authorid}>"><{$content_author}></a> <{/if}><{if $content_dodate}><{$smarty.const._MD_PAGE_VIEWPAGE_ON}> <{$content_date}> <{$content_time}> <{/if}><{if $content_dohits}><{$content_hits}><{/if}> + </div> + <{if $content_doncoms}> + <div class="page_footerright"> + <img src="<{$xoops_url}>/modules/page/images/comments.png" alt="<{$content_comments}>"/> (<{$content_comments}> <{$smarty.const._MD_PAGE_VIEWPAGE_COMMENTS}>) + </div> + <{/if}> + </div> + <{/if}> + </div> + <div id="page-footer-print"> + <{$smarty.const._MD_PAGE_PRINT_COMES}> <{$xoops_sitename}> + <br /> + <a href="<{$xoops_url}>" title="<{$xoops_sitename}>"><{$xoops_url}></a> + <br /> + <br /> + <{$smarty.const._MD_PAGE_PRINT_URL}> + <br /> + <a href="<{$xoops_url}>/modules/page/viewpage.php?id=<{$content_id}>" title="<{$xoops_sitename}>"><{$xoops_url}>/modules/page/viewpage.php?id=<{$content_id}></a> + </div> +</body> +</html> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_viewpage.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_viewpage.html 2012-12-02 15:44:57 UTC (rev 10298) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/templates/page_viewpage.html 2012-12-02 16:21:02 UTC (rev 10299) @@ -48,6 +48,12 @@ <{includeq file="module:page|page_navigation.html"}> <div class="clear"></div> <{/if}> + + <div class="right"> + <{if $content_doprint}> + <a href="<{$xoops_url}>/modules/page/print.php?id=<{$content_id}>" title="<{$smarty.const._MD_PAGE_VIEWPAGE_PRINT}>"><img src="<{xoAppUrl media/xoops/images/icons/16/printer.png}>" alt="<{$smarty.const._MD_PAGE_VIEWPAGE_PRINT}>" /></a> + <{/if}> + </div> </div> <{if $content_dofooter}> <div class="page_footer"> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/xoops_version.php 2012-12-02 15:44:57 UTC (rev 10298) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/xoops_version.php 2012-12-02 16:21:02 UTC (rev 10299) @@ -83,6 +83,7 @@ // Templates $modversion['templates'][] = array( 'file' => 'page_index.html', 'description' => '' ); $modversion['templates'][] = array( 'file' => 'page_viewpage.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'page_print.html', 'description' => '' ); // blocks $i = 0; |
From: <tr...@us...> - 2012-12-02 15:45:03
|
Revision: 10298 http://sourceforge.net/p/xoops/svn/10298 Author: trabis Date: 2012-12-02 15:44:57 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Updating cache engines and moving new classes to xoops_lib Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/apc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image/scripts/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/xoopseditor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/checklogin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php XoopsCore/branches/2.6.x/2.6.0/upgrade/login.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/Ads.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/Factory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/Ldap.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/Provisioning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth/Xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Auth.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/Abstract.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/Apc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/File.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/Memcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/Model.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/Redis.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/Wincache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/Xcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Cache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php Property Changed: ---------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/ XoopsCore/branches/2.6.x/2.6.0/htdocs/uploads/ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_data/data/ Modified: XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt 2012-12-01 22:36:45 UTC (rev 10297) +++ XoopsCore/branches/2.6.x/2.6.0/docs/changelog.26.txt 2012-12-02 15:44:57 UTC (rev 10298) @@ -1,6 +1,11 @@ XOOPS 2.6 Changelog =============================== +2012/12: Version 2.6.0 Alpha 2 +=============================== +Updating cache engines (trabis) + +=============================== 2012/08: Version 2.6.0 Alpha 1 =============================== @@ -46,7 +51,7 @@ 9570 change userrank.html to help.html in userrank plugin (mage) 9569 Changing _SEND to _SUBMIT in Maintenance (mamba) 9567 Update insertBreak in themform.php and modification in the system module (mage) -9566 Change in the plugin maintenance. For the part dump modules and plugins are displayed if they have a sql table. (mage) +9566 Change in the plugin maintenance. For the part dump modules and plugins are displayed if they have a sql table. (mage) 9565 change constant language error (mage) 9562 update userrank with new form (mage) 9561 The description is no longer displayed with the title to the preferences of modules / plugins (mage) @@ -162,7 +167,7 @@ 8491 Update module logo (formuss) 8487 Smilies and userrank final (mage) 8486 Updating to jQuery 1.71 (mamba) -8483 Adding back the modules admin template. +8483 Adding back the modules admin template. 8482 Refactor module class (formuss) 8472 Fix an error when user log out (formuss) 8471 Updated banners (draft 1) (mage) @@ -243,7 +248,7 @@ 8235 Renaming reource from blocks to block to match tplfile type in database (trabis) 8234 adding new resources to replace db:template.html. (trabis) You can now use module:dirname|template.html You can now use block:dirname|template.html You can now use admin:dirname|template.html (trabis) -All resources look for override templates in theme dir +All resources look for override templates in theme dir You can use this new resources inside templates: <{includeq file="module:system|system_header.html"}> Or on any template object: Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks ___________________________________________________________________ Modified: svn:ignore - PEAR art captcha fpdf graphs readme.schinese.txt textsanitizer transfer xoops22 xoops_version.php + PEAR art captcha fpdf graphs readme.schinese.txt textsanitizer transfer xoops22 xoops_version.php moduleclasses Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php 2012-12-01 22:36:45 UTC (rev 10297) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php 2012-12-02 15:44:57 UTC (rev 10298) @@ -60,7 +60,7 @@ $dirname = ($dirname) ? $dirname : $xoops->moduleDirname; $key = "{$dirname}_{$name}"; - return XoopsCache::write($key, $data); + return Xoops_Cache::write($key, $data); } /** @@ -105,7 +105,7 @@ $dirname = ($dirname) ? $dirname : $xoops->moduleDirname; $key = "{$dirname}_{$name}"; - return XoopsCache::read($key); + return Xoops_Cache::read($key); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php 2012-12-01 22:36:45 UTC (rev 10297) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php 2012-12-02 15:44:57 UTC (rev 10298) @@ -36,9 +36,9 @@ } } else { - if (!$moduleConfig = XoopsCache::read("{$dirname}_config")) { + if (!$moduleConfig = Xoops_Cache::read("{$dirname}_config")) { $moduleConfig = mod_fetchConfig($dirname); - XoopsCache::write("{$dirname}_config", $moduleConfig); + Xoops_Cache::write("{$dirname}_config", $moduleConfig); } } if ($customConfig = @include XOOPS_ROOT_PATH . "/modules/{$dirname}/include/plugin.php") { @@ -105,7 +105,7 @@ } - return XoopsCache::delete("{$dirname}_config"); + return Xoops_Cache::delete("{$dirname}_config"); } function mod_clearConfg($dirname = "") Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php 2012-12-01 22:36:45 UTC (rev 10297) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php 2012-12-02 15:44:57 UTC (rev 10298) @@ -87,7 +87,7 @@ $rssfile = 'adminnews-' . $xoops->getConfig('language'); $items = array(); - if (!$items = XoopsCache::read($rssfile)) { + if (!$items = Xoops_Cache::read($rssfile)) { $snoopy = new Snoopy(); $cnt = 0; foreach ($rssurl as $url) { @@ -108, |