From: <tr...@us...> - 2011-10-22 14:27:26
|
Revision: 7923 http://xoops.svn.sourceforge.net/xoops/?rev=7923&view=rev Author: trabis Date: 2011-10-22 14:27:20 +0000 (Sat, 22 Oct 2011) Log Message: ----------- pm using abstract XoopsForm Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php 2011-10-22 14:22:35 UTC (rev 7922) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php 2011-10-22 14:27:20 UTC (rev 7923) @@ -107,7 +107,7 @@ } $GLOBALS['xoopsTpl'] = new XoopsTpl(); - $pmform = new XoopsForm('', 'pmform', 'pmlite.php', 'post', true); + $pmform = new XoopsThemeForm('', 'pmform', 'pmlite.php', 'post', true); if ($reply == 1) { $subject = $pm->getVar('subject', 'E'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php 2011-10-22 14:22:35 UTC (rev 7922) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php 2011-10-22 14:27:20 UTC (rev 7923) @@ -133,7 +133,7 @@ list($pm) = $pm_handler->getObjects($criteria); } -$pmform = new XoopsForm('', 'pmform', 'readpmsg.php', 'post', true); +$pmform = new XoopsThemeForm('', 'pmform', 'readpmsg.php', 'post', true); if (is_object($pm) && !empty($pm)) { if ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) { $reply_button = new XoopsFormButton('', 'send', _PM_REPLY); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php 2011-10-22 14:22:35 UTC (rev 7922) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php 2011-10-22 14:27:20 UTC (rev 7923) @@ -219,7 +219,7 @@ $move_button = new XoopsFormButton('', 'move_messages', ($_REQUEST['op'] == 'save') ? _PM_UNSAVE : _PM_TOSAVE, 'submit'); $empty_button = new XoopsFormButton('', 'empty_messages', _PM_EMPTY, 'submit'); -$pmform = new XoopsForm('', 'pmform', 'viewpmsg.php', 'post', true); +$pmform = new XoopsThemeForm('', 'pmform', 'viewpmsg.php', 'post', true); $pmform->addElement($send_button); $pmform->addElement($move_button); $pmform->addElement($delete_button); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-11-16 20:46:51
|
Revision: 8306 http://xoops.svn.sourceforge.net/xoops/?rev=8306&view=rev Author: trabis Date: 2011-11-16 20:46:43 +0000 (Wed, 16 Nov 2011) Log Message: ----------- Refactoring pm module Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/admin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.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/pm/class/message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/install.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/update.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/core.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/system.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/admin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/admin.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/admin.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private message * - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -16,8 +19,10 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ -include 'header.php'; -xoops_cp_header(); + +include dirname(__FILE__) . '/header.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); echo ' '; -xoops_cp_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/pm/admin/header.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/header.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/header.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private message * - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -17,9 +20,4 @@ * @version $Id$ */ -require_once "../../../include/cp_header.php"; - -if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { - $GLOBALS['xoopsTpl'] = new XoopsTpl(); -} -?> \ No newline at end of file +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private message * - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -16,9 +19,8 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ -$adminmenu = array(); +$adminmenu = array(); $adminmenu[1]['title'] = _PM_MI_INDEX; $adminmenu[1]['link'] = "admin/admin.php"; $adminmenu[2]['title'] = _PM_MI_PRUNE; -$adminmenu[2]['link'] = "admin/prune.php"; -?> \ No newline at end of file +$adminmenu[2]['link'] = "admin/prune.php"; \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private message * - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -17,70 +20,69 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ -include 'header.php'; -xoops_cp_header(); +include dirname(__FILE__) . '/header.php'; $xoops = Xoops::getInstance(); +$xoops->header(); $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : "form"; +/* @var $pm_handler PmMessageHandler */ $pm_handler = $xoops->getModuleHandler('message'); switch ($op) { -default: -case "form": - $form = $pm_handler->getPruneForm(); - $form->display(); - break; + default: + case "form": + $form = $pm_handler->getPruneForm(); + $form->display(); + break; -case "prune": - $criteria = new CriteriaCompo(); - if ($_REQUEST['after']['date'] && $_REQUEST['after']['date'] != "YYYY/MM/DD") { - $criteria->add(new Criteria('msg_time', strtotime($_REQUEST['after']['date']) + intval($_REQUEST['after']['time']), ">")); - } - if ($_REQUEST['before']['date'] && $_REQUEST['before']['date'] != "YYYY/MM/DD") { - $criteria->add(new Criteria('msg_time', strtotime($_REQUEST['before']['date']) + intval($_REQUEST['before']['time']), "<")); - } - if (isset($_REQUEST['onlyread']) && $_REQUEST['onlyread'] == 1) { - $criteria->add(new Criteria('read_msg', 1)); - } - if ((!isset($_REQUEST['includesave']) || $_REQUEST['includesave'] == 0)) { - $savecriteria = new CriteriaCompo(new Criteria('to_save', 0)); - $savecriteria->add(new Criteria('from_save', 0)); - $criteria->add($savecriteria); - } - if (isset($_REQUEST['notifyusers']) && $_REQUEST['notifyusers'] == 1) { - $notifycriteria = $criteria; - $notifycriteria->add(new Criteria('to_delete', 0)); - $notifycriteria->setGroupBy('to_userid'); - // Get array of uid => number of deleted messages - $uids = $pm_handler->getCount($notifycriteria); - } - $deletedrows = $pm_handler->deleteAll($criteria); - if ($deletedrows === false) { - $xoops->redirect('prune.php', 2, _PM_AM_ERRORWHILEPRUNING); - } - if (isset($_REQUEST['notifyusers']) && $_REQUEST['notifyusers'] == 1) { - $errors = false; - foreach ($uids as $uid => $messagecount) { - $pm = $pm_handler->create(); - $pm->setVar("subject", $GLOBALS['xoopsModuleConfig']['prunesubject']); - $pm->setVar("msg_text", str_replace('{PM_COUNT}', $messagecount, $GLOBALS['xoopsModuleConfig']['prunemessage'])); - $pm->setVar("to_userid", $uid); - $pm->setVar("from_userid", $GLOBALS['xoopsUser']->getVar("uid")); - $pm->setVar("msg_time", time()); - if (!$pm_handler->insert($pm)) { - $errors = true; - $errormsg[] = $pm->getHtmlErrors(); + case "prune": + $criteria = new CriteriaCompo(); + if ($_REQUEST['after']['date'] && $_REQUEST['after']['date'] != "YYYY/MM/DD") { + $criteria->add(new Criteria('msg_time', strtotime($_REQUEST['after']['date']) + intval($_REQUEST['after']['time']), ">")); + } + if ($_REQUEST['before']['date'] && $_REQUEST['before']['date'] != "YYYY/MM/DD") { + $criteria->add(new Criteria('msg_time', strtotime($_REQUEST['before']['date']) + intval($_REQUEST['before']['time']), "<")); + } + if (isset($_REQUEST['onlyread']) && $_REQUEST['onlyread'] == 1) { + $criteria->add(new Criteria('read_msg', 1)); + } + if ((!isset($_REQUEST['includesave']) || $_REQUEST['includesave'] == 0)) { + $savecriteria = new CriteriaCompo(new Criteria('to_save', 0)); + $savecriteria->add(new Criteria('from_save', 0)); + $criteria->add($savecriteria); + } + if (isset($_REQUEST['notifyusers']) && $_REQUEST['notifyusers'] == 1) { + $notifycriteria = $criteria; + $notifycriteria->add(new Criteria('to_delete', 0)); + $notifycriteria->setGroupBy('to_userid'); + // Get array of uid => number of deleted messages + $uids = $pm_handler->getCount($notifycriteria); + } + $deletedrows = $pm_handler->deleteAll($criteria); + if ($deletedrows === false) { + $xoops->redirect('prune.php', 2, _PM_AM_ERRORWHILEPRUNING); + } + if (isset($_REQUEST['notifyusers']) && $_REQUEST['notifyusers'] == 1) { + $errors = false; + foreach ($uids as $uid => $messagecount) { + $pm = $pm_handler->create(); + $pm->setVar("subject", $xoops->getModuleConfig('prunesubject')); + $pm->setVar("msg_text", str_replace('{PM_COUNT}', $messagecount, $xoops->getModuleConfig('prunemessage'))); + $pm->setVar("to_userid", $uid); + $pm->setVar("from_userid", $xoops->user->getVar("uid")); + $pm->setVar("msg_time", time()); + if (!$pm_handler->insert($pm)) { + $errors = true; + $errormsg[] = $pm->getHtmlErrors(); + } + unset($pm); } - unset($pm); + if ($errors == true) { + echo implode('<br />', $errormsg); + $xoops->footer(); + } } - if ($errors == true) { - echo implode('<br />', $errormsg); - xoops_cp_footer(); - exit(); - } - } - $xoops->redirect('admin.php', 2, sprintf(_PM_AM_MESSAGESPRUNED, $deletedrows)); - break; + $xoops->redirect('admin.php', 2, sprintf(_PM_AM_MESSAGESPRUNED, $deletedrows)); + break; } -xoops_cp_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/pm/class/message.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/class/message.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/class/message.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private message 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. - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -19,8 +22,6 @@ */ /** - * {description} - * * @package pm * * @author Kazumi Ono <on...@xo...> @@ -28,7 +29,10 @@ */ class PmMessage extends XoopsObject { - function __construct() + /** + * Constructor + */ + public function __construct() { $this->initVar('msg_id', XOBJ_DTYPE_INT, null, false); $this->initVar('msg_image', XOBJ_DTYPE_OTHER, 'icon1.gif', false, 100); @@ -48,8 +52,10 @@ class PmMessageHandler extends XoopsPersistableObjectHandler { - - function __construct($db) + /** + * @param null|XoopsDatabase $db + */ + public function __construct(XoopsDatabase $db = null) { parent::__construct($db, "priv_msgs", 'PmMessage', 'msg_id', 'subject'); } @@ -57,20 +63,23 @@ /** * Mark a message as read * - * @param object $pm {@link PmMessage} object - * @return bool - **/ - function setRead($pm, $val = 1) + * @param XoopsObject|PmMessage $pm + * @param int $val + * @return bool + */ + public function setRead(PmMessage $pm, $val = 1) { return $this->updateAll('read_msg', intval($val), new Criteria('msg_id', $pm->getVar('msg_id')), true); } /** * Mark a message as from_delete = 1 or removes it if the recipient has also deleted it - * @param object $pm {@link PmMessage} object - * @return bool - **/ - function setFromdelete($pm, $val = 1) + * + * @param XoopsObject|PmMessage $pm + * @param int $val + * @return bool + */ + public function setFromdelete(PmMessage $pm, $val = 1) { if ($pm->getVar('to_delete') == 0) { return $this->updateAll('from_delete', intval($val), new Criteria('msg_id', $pm->getVar('msg_id'))); @@ -81,10 +90,12 @@ /** * Mark a message as to_delete = 1 or removes it if the sender has also deleted it or sent by anonymous - * @param object $pm {@link PmMessage} object - * @return bool - **/ - function setTodelete($pm, $val = 1) + * + * @param XoopsObject|PmMessage $pm + * @param int $val + * @return bool + */ + public function setTodelete(PmMessage $pm, $val = 1) { if ($pm->getVar('from_delete') == 0 && $pm->getVar('from_userid') == 0) { return $this->updateAll('to_delete', intval($val), new Criteria('msg_id', $pm->getVar('msg_id'))); @@ -95,33 +106,39 @@ /** * Mark a message as from_save = 1 - * @param object $pm {@link PmMessage} object - * @return bool - **/ - function setFromsave($pm, $val = 1) + * + * @param XoopsObject|PmMessage $pm + * @param int $val + * @return bool + */ + public function setFromsave(PmMessage $pm, $val = 1) { return $this->updateAll('from_save', intval($val), new Criteria('msg_id', $pm->getVar('msg_id'))); } /** * Mark a message as to_save = 1 - * @param object $pm {@link PmMessage} object - * @return bool - **/ - function setTosave($pm, $val = 1) + * + * @param XoopsObject|PmMessage $pm + * @param int $val + * @return bool + */ + public function setTosave(PmMessage $pm, $val = 1) { return $this->updateAll('to_save', intval($val), new Criteria('msg_id', $pm->getVar('msg_id'))); } /** * get user's message count in savebox - * @param object $user - * @return int - **/ - function getSavecount($user = null) + * + * @param XoopsUser|null $user + * @return int + */ + public function getSavecount(XoopsUser $user = null) { + $xoops = Xoops::getInstance(); if (!is_object($user)) { - $user = $GLOBALS["xoopsUser"]; + $user = $xoops->user; } $crit_to = new CriteriaCompo(new Criteria('to_delete', 0)); $crit_to->add(new Criteria('to_save', 1)); @@ -136,16 +153,16 @@ /** * Send a message to user's email - * @param object $pm {@link XoopsPrivmessage} object - * @param object $user - * @return bool - **/ - function sendEmail($pm, $user) + * + * @param XoopsObject|PmMessage $pm + * @param null|XoopsUser $user + * @return bool + */ + public function sendEmail(PmMessage $pm, XoopsUser $user = null) { - global $xoopsConfig; - + $xoops = Xoops::getInstance(); if (!is_object($user)) { - $user = $GLOBALS["xoopsUser"]; + $user = $xoops->user; } $msg = sprintf(_PM_EMAIL_DESC, $user->getVar("uname")); $msg .= "\n\n"; @@ -159,26 +176,28 @@ $msg .= "\n"; $msg .= _PM_EMAIL_MESSAGE . ":\n"; $msg .= "\n" . $pm->getVar("subject") . "\n"; - $msg .= "\n" . strip_tags( str_replace(array("<p>", "</p>", "<br />", "<br />"), "\n", $pm->getVar("msg_text")) ) . "\n\n"; + $msg .= "\n" . strip_tags(str_replace(array( + "<p>", "</p>", "<br />", "<br />" + ), "\n", $pm->getVar("msg_text"))) . "\n\n"; $msg .= "--------------\n"; - $msg .= $xoopsConfig['sitename'] . ": ". XOOPS_URL . "\n"; + $msg .= $xoops->getConfig('sitename') . ": " . XOOPS_URL . "\n"; $xoopsMailer = $xoops->getMailer(); $xoopsMailer->useMail(); $xoopsMailer->setToEmails($user->getVar("email")); - $xoopsMailer->setFromEmail($xoopsConfig['adminmail']); - $xoopsMailer->setFromName($xoopsConfig['sitename']); + $xoopsMailer->setFromEmail($xoops->getConfig('adminmail')); + $xoopsMailer->setFromName($xoops->getConfig('sitename')); $xoopsMailer->setSubject(sprintf(_PM_EMAIL_SUBJECT, $pm->getVar("subject"))); $xoopsMailer->setBody($msg); return $xoopsMailer->send(); } /** - * Get {@link XoopsForm} for setting prune criteria - * - * @return object - **/ - function getPruneForm() + * Get {@link XoopsForm} for setting prune criteria + * + * @return XoopsThemeForm + **/ + public function getPruneForm() { $form = new XoopsThemeForm(_PM_AM_PRUNE, 'form', 'prune.php', 'post', true); @@ -187,11 +206,9 @@ $form->addElement(new XoopsFormRadioYN(_PM_AM_ONLYREADMESSAGES, 'onlyread', 1)); $form->addElement(new XoopsFormRadioYN(_PM_AM_INCLUDESAVE, 'includesave', 0)); $form->addElement(new XoopsFormRadioYN(_PM_AM_NOTIFYUSERS, 'notifyusers', 0)); - $form->addElement(new XoopsFormHidden('op', 'prune')); $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); return $form; } -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/install.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/install.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/install.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private Message * - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -17,22 +20,25 @@ * @version $Id$ */ -function xoops_module_install_pm($module) +/** + * @param XoopsModule $module + * @return bool|void + */ +function xoops_module_install_pm($module) { - global $xoopsDB; - + $xoops = Xoops::getInstance(); + // Check pm table version - $sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("priv_msgs"); - if (!$result = $xoopsDB->queryF($sql)) { + $sql = "SHOW COLUMNS FROM " . $xoops->db->prefix("priv_msgs"); + if (!$result = $xoops->db->queryF($sql)) { return false; } // Migrate from existent pm module - if ( ($rows = $xoopsDB->getRowsNum($result)) == 12) { + if (($rows = $xoops->db->getRowsNum($result)) == 12) { return true; } elseif ($rows == 8) { - return $xoopsDB->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/sql/mysql.upgrade.sql"); + return $xoops->db->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/sql/mysql.upgrade.sql"); } else { return false; } -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/update.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/update.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/update.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private Message * - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -17,24 +20,28 @@ * @version $Id$ */ -function xoops_module_update_pm(&$module, $oldversion = null) +/** + * @param XoopsModule $module + * @param string|null $oldversion + * @return bool|void + */ +function xoops_module_update_pm(&$module, $oldversion = null) { - + $xoops = Xoops::getInstance(); if ($oldversion <= 100) { - GLOBAL $xoopsDB; - // Check pm table version - $sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("priv_msgs"); - if (!$result = $xoopsDB->queryF($sql)) { - return false; + // Check pm table version + $sql = "SHOW COLUMNS FROM " . $xoops->db->prefix("priv_msgs"); + if (!$result = $xoops->db->queryF($sql)) { + return false; + } + // Migrate from existent pm module + if (($rows = $xoops->db->getRowsNum($result)) == 12) { + return true; + } elseif ($rows == 8) { + return $xoops->db->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/sql/mysql.upgrade.sql"); + } else { + return false; + } } - // Migrate from existent pm module - if ( ($rows = $xoopsDB->getRowsNum($result)) == 12) { - return true; - } elseif ($rows == 8) { - return $xoopsDB->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/sql/mysql.upgrade.sql"); - } else { - return false; - } - } -} -?> \ No newline at end of file + return true; +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/index.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/index.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private message 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. - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -17,5 +20,5 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ -header('location: viewpmsg.php'); -?> \ No newline at end of file + +header('location: viewpmsg.php'); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private message 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. - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -26,30 +29,33 @@ $xoops = Xoops::getInstance(); $xoops->loadLanguage('main', 'pm'); -$reply = !empty($_GET['reply']) ? 1 : 0; -$send = !empty($_GET['send']) ? 1 : 0; -$send2 = !empty($_GET['send2']) ? 1 : 0; -$sendmod = !empty($_POST['sendmod']) ? 1 : 0; // send from other modules with post data -$to_userid = isset($_GET['to_userid']) ? intval($_GET['to_userid']) : 0; -$msg_id = isset($_GET['msg_id']) ? intval($_GET['msg_id']) : 0; +$reply = !empty($_GET['reply']) ? 1 : 0; +$send = !empty($_GET['send']) ? 1 : 0; +$send2 = !empty($_GET['send2']) ? 1 : 0; +$sendmod = !empty($_POST['sendmod']) ? 1 : 0; // send from other modules with post data +$to_userid = isset($_GET['to_userid']) ? intval($_GET['to_userid']) : 0; +$msg_id = isset($_GET['msg_id']) ? intval($_GET['msg_id']) : 0; if (empty($_GET['refresh']) && isset($_POST['op']) && $_POST['op'] != "submit") { $jump = "pmlite.php?refresh=" . time(); if ($send == 1) { $jump .= "&send={$send}"; - } else if ($send2 == 1) { - $jump .= "&send2={$send2}&to_userid={$to_userid}"; - } else if ($reply == 1) { - $jump .= "&reply={$reply}&msg_id={$msg_id}"; } else { + if ($send2 == 1) { + $jump .= "&send2={$send2}&to_userid={$to_userid}"; + } else { + if ($reply == 1) { + $jump .= "&reply={$reply}&msg_id={$msg_id}"; + } else { + } + } } header('location: ' . $jump); exit(); } -if (!is_object($GLOBALS['xoopsUser'])) { +if (!$xoops->isUser()) { $xoops->redirect(XOOPS_URL, 3, _NOPERM); - exit(); } $xoops->simpleHeader(); @@ -58,107 +64,112 @@ $member_handler = $xoops->getHandlerMember(); $count = $member_handler->getUserCount(new Criteria('uid', intval($_POST['to_userid']))); if ($count != 1) { - echo "<br /><br /><div><h4>"._PM_USERNOEXIST."<br />"; - echo _PM_PLZTRYAGAIN."</h4><br />"; - echo "[ <a href='javascript:history.go(-1)'>"._PM_GOBACK."</a> ]</div>"; - } else if ($GLOBALS['xoopsSecurity']->check()) { - $pm_handler = $xoops->getModuleHandler('message', 'pm'); - $pm = $pm_handler->create(); - $pm->setVar("msg_time", time()); -//------------------ mamba -if (isset($_POST['icon'])) { - $pm->setVar("msg_image", $_POST['icon']); - } - //else $pm->setVar("msg_image", 'icon1.gif'); -//----------------- mamba - $pm->setVar("subject", $_POST['subject']); - $pm->setVar("msg_text", $_POST['message']); - $pm->setVar("to_userid", $_POST['to_userid']); - $pm->setVar("from_userid", $GLOBALS['xoopsUser']->getVar("uid")); - if (isset($_REQUEST['savecopy']) && $_REQUEST['savecopy'] == 1) { - //PMs are by default not saved in outbox - $pm->setVar('from_delete', 0); - } - if (!$pm_handler->insert($pm)) { - echo $pm->getHtmlErrors(); - echo "<br /><a href='javascript:history.go(-1)'>"._PM_GOBACK."</a>"; - } else { - // @todo: Send notification email if user has selected this in the profile - - echo "<br /><br /><div style='text-align:center;'><h4>" . _PM_MESSAGEPOSTED . "</h4><br /><a href=\"javascript:window.opener.location='".XOOPS_URL."/viewpmsg.php';window.close();\">"._PM_CLICKHERE."</a><br /><br /><a href=\"javascript:window.close();\">"._PM_ORCLOSEWINDOW."</a></div>"; - } + echo "<br /><br /><div><h4>" . _PM_USERNOEXIST . "<br />"; + echo _PM_PLZTRYAGAIN . "</h4><br />"; + echo "[ <a href='javascript:history.go(-1)'>" . _PM_GOBACK . "</a> ]</div>"; } else { - echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()); - echo "<br /><a href=\"javascript:window.close();\">"._PM_ORCLOSEWINDOW."</a>"; - } + if ($xoops->security->check()) { + $pm_handler = $xoops->getModuleHandler('message', 'pm'); + $pm = $pm_handler->create(); + $pm->setVar("msg_time", time()); + //------------------ mamba + if (isset($_POST['icon'])) { + $pm->setVar("msg_image", $_POST['icon']); + } + //else $pm->setVar("msg_image", 'icon1.gif'); + //----------------- mamba + $pm->setVar("subject", $_POST['subject']); + $pm->setVar("msg_text", $_POST['message']); + $pm->setVar("to_userid", $_POST['to_userid']); + $pm->setVar("from_userid", $GLOBALS['xoopsUser']->getVar("uid")); + if (isset($_REQUEST['savecopy']) && $_REQUEST['savecopy'] == 1) { + //PMs are by default not saved in outbox + $pm->setVar('from_delete', 0); + } + if (!$pm_handler->insert($pm)) { + echo $pm->getHtmlErrors(); + echo "<br /><a href='javascript:history.go(-1)'>" . _PM_GOBACK . "</a>"; + } else { + // @todo: Send notification email if user has selected this in the profile -} else if ($reply == 1 || $send == 1 || $send2 == 1 || $sendmod == 1) { - if ($reply == 1) { - $pm_handler = $xoops->getModuleHandler('message', 'pm'); - $pm = $pm_handler->get($msg_id); - if ($pm->getVar("to_userid") == $GLOBALS['xoopsUser']->getVar('uid')) { - $pm_uname = XoopsUser::getUnameFromId($pm->getVar("from_userid")); - $message = "[quote]\n"; - $message .= sprintf(_PM_USERWROTE , $pm_uname); - $message .= "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]"; + echo "<br /><br /><div style='text-align:center;'><h4>" . _PM_MESSAGEPOSTED . "</h4><br /><a href=\"javascript:window.opener.location='" . XOOPS_URL . "/viewpmsg.php';window.close();\">" . _PM_CLICKHERE . "</a><br /><br /><a href=\"javascript:window.close();\">" . _PM_ORCLOSEWINDOW . "</a></div>"; + } } else { - unset($pm); - $reply = $send2 = 0; + echo implode('<br />', $xoops->security->getErrors()); + echo "<br /><a href=\"javascript:window.close();\">" . _PM_ORCLOSEWINDOW . "</a>"; } } - $GLOBALS['xoopsTpl'] = new XoopsTpl(); - $pmform = new XoopsThemeForm('', 'pmform', 'pmlite.php', 'post', true); +} else { + if ($reply == 1 || $send == 1 || $send2 == 1 || $sendmod == 1) { + if ($reply == 1) { + $pm_handler = $xoops->getModuleHandler('message', 'pm'); + $pm = $pm_handler->get($msg_id); + if ($pm->getVar("to_userid") == $xoops->user->getVar('uid')) { + $pm_uname = XoopsUser::getUnameFromId($pm->getVar("from_userid")); + $message = "[quote]\n"; + $message .= sprintf(_PM_USERWROTE, $pm_uname); + $message .= "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]"; + } else { + unset($pm); + $reply = $send2 = 0; + } + } - if ($reply == 1) { - $subject = $pm->getVar('subject', 'E'); - if (!preg_match("/^" . _RE . "/i", $subject)) { - $subject = _RE . ' ' . $subject; - } - $GLOBALS['xoopsTpl']->assign('to_username', $pm_uname); - $pmform->addElement(new XoopsFormHidden('to_userid', $pm->getVar("from_userid"))); - } else if ($sendmod == 1) { - $GLOBALS['xoopsTpl']->assign('to_username', XoopsUser::getUnameFromId($_POST["to_userid"])); - $pmform->addElement(new XoopsFormHidden('to_userid', $_POST["to_userid"])); - $subject = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['subject'])); - $message = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['message'])); - } else { - if ($send2 == 1) { - $GLOBALS['xoopsTpl']->assign('to_username', XoopsUser::getUnameFromId($to_userid, false)); - $pmform->addElement(new XoopsFormHidden('to_userid', $to_userid)); + $tpl = new XoopsTpl(); + $pmform = new XoopsThemeForm('', 'pmform', 'pmlite.php', 'post', true); + + if ($reply == 1) { + $subject = $pm->getVar('subject', 'E'); + if (!preg_match("/^" . _RE . "/i", $subject)) { + $subject = _RE . ' ' . $subject; + } + $tpl->assign('to_username', $pm_uname); + $pmform->addElement(new XoopsFormHidden('to_userid', $pm->getVar("from_userid"))); } else { - $to_username = new XoopsFormSelectUser('', 'to_userid'); - $GLOBALS['xoopsTpl']->assign('to_username', $to_username->render()); + if ($sendmod == 1) { + $tpl->assign('to_username', XoopsUser::getUnameFromId($_POST["to_userid"])); + $pmform->addElement(new XoopsFormHidden('to_userid', $_POST["to_userid"])); + $subject = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['subject'])); + $message = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['message'])); + } else { + if ($send2 == 1) { + $tpl->assign('to_username', XoopsUser::getUnameFromId($to_userid, false)); + $pmform->addElement(new XoopsFormHidden('to_userid', $to_userid)); + } else { + $to_username = new XoopsFormSelectUser('', 'to_userid'); + $tpl->assign('to_username', $to_username->render()); + } + $subject = ""; + $message = ""; + } } - $subject = ""; - $message = ""; - } - $pmform->addElement(new XoopsFormText('', 'subject', 30, 100, $subject), true); + $pmform->addElement(new XoopsFormText('', 'subject', 30, 100, $subject), true); -//----------------------------- mamba - $msg_image=''; - $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'msg_image', $msg_image); - $subject_icons = XoopsLists::getSubjectsList(); - // foreach ($subject_icons as $iconfile) { - // $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); - // } - // $pmform->addElement($icons_radio, true); + //----------------------------- mamba + $msg_image = ''; + $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'msg_image', $msg_image); + $subject_icons = XoopsLists::getSubjectsList(); + // foreach ($subject_icons as $iconfile) { + // $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); + // } + // $pmform->addElement($icons_radio, true); - $xoopsTpl->assign('radio_icons', $subject_icons); -//------------------------------- mamba + $tpl->assign('radio_icons', $subject_icons); + //------------------------------- mamba + $pmform->addElement(new XoopsFormDhtmlTextArea('', 'message', $message, 8, 37), true); + $pmform->addElement(new XoopsFormRadioYN('', 'savecopy', 0)); - $pmform->addElement(new XoopsFormDhtmlTextArea('', 'message', $message, 8, 37), true); - $pmform->addElement(new XoopsFormRadioYN('', 'savecopy', 0)); + $pmform->addElement(new XoopsFormHidden('op', 'submit')); + $pmform->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $pmform->addElement(new XoopsFormButton('', 'reset', _PM_CLEAR, 'reset')); - $pmform->addElement(new XoopsFormHidden('op', 'submit')); - $pmform->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - $pmform->addElement(new XoopsFormButton('', 'reset', _PM_CLEAR, 'reset')); - - $cancel_send = new XoopsFormButton('', 'cancel', _PM_CANCELSEND, 'button'); - $cancel_send->setExtra("onclick='javascript:window.close();'"); - $pmform->addElement($cancel_send); - $pmform->assign($GLOBALS['xoopsTpl']); - $GLOBALS['xoopsTpl']->display("module:pm|pm_pmlite.html"); + $cancel_send = new XoopsFormButton('', 'cancel', _PM_CANCELSEND, 'button'); + $cancel_send->setExtra("onclick='javascript:window.close();'"); + $pmform->addElement($cancel_send); + $pmform->assign($tpl); + $tpl->display("module:pm|pm_pmlite.html"); + } } $xoops->simpleFooter(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/core.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/core.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/core.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private Messages * - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -29,29 +32,47 @@ class PmCorePreload extends XoopsPreloadItem { - static function eventCorePmliteStart($args) + /** + * @static + * @param array $args + * @return void + */ + static public function eventCorePmliteStart($args) { header("location: ./modules/pm/pmlite.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING'])); exit(); } - static function eventCoreReadpmsgStart($args) + /** + * @static + * @param array $args + * @return void + */ + static public function eventCoreReadpmsgStart($args) { header("location: ./modules/pm/readpmsg.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING'])); exit(); } - static function eventCoreViewpmsgStart($args) + /** + * @static + * @param array $args + * @return void + */ + static public function eventCoreViewpmsgStart($args) { header("location: ./modules/pm/viewpmsg.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING'])); exit(); } - static function eventCoreClassSmartyXoops_pluginsXoinboxcount($args) + /** + * @static + * @param array $args + * @return void + */ + static public function eventCoreClassSmartyXoops_pluginsXoinboxcount($args) { - $xoops = Xoops::getInstance(); - $args[0] = $xoops->getModuleHandler('message', 'pm'); + $args[0] = Xoops::getInstance()->getModuleHandler('message', 'pm'); } -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/system.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/system.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/system.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private Messages * - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -28,12 +31,14 @@ */ class PmSystemPreload extends XoopsPreloadItem { - - static function eventSystemBlocksSystem_blocksUsershow($args) + /** + * @static + * @param array $args + * @return void + */ + static public function eventSystemBlocksSystem_blocksUsershow($args) { - $xoops = Xoops::getInstance(); - $args[0] = $xoops->getModuleHandler('message', 'pm'); + $args[0] = Xoops::getInstance()->getModuleHandler('message', 'pm'); } -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private message 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. - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -21,13 +24,13 @@ include_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -if (!is_object($GLOBALS['xoopsUser'])) { +if (!$xoops->isUser()) { $xoops->redirect(XOOPS_URL, 3, _NOPERM); - exit(); } $valid_op_requests = array('out', 'save', 'in'); $_REQUEST['op'] = !empty($_REQUEST['op']) && in_array($_REQUEST['op'], $valid_op_requests) ? $_REQUEST['op'] : 'in' ; $msg_id = empty($_REQUEST['msg_id']) ? 0 : intval($_REQUEST['msg_id']); +/* @var $pm_handler PmMessageHandler */ $pm_handler = $xoops->getModuleHandler('message'); if ($msg_id > 0) { $pm = $pm_handler->get($msg_id); @@ -35,31 +38,30 @@ $pm = null; } -if (is_object($pm) && !$GLOBALS['xoopsUser']->isAdmin() && ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) - && ($pm->getVar('to_userid') != $GLOBALS['xoopsUser']->getVar('uid')) +if (is_object($pm) && !$xoops->user->isAdmin() && ($pm->getVar('from_userid') != $xoops->user->getVar('uid')) + && ($pm->getVar('to_userid') != $xoops->user->getVar('uid')) ){ - $xoops->redirect(XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar("dirname", "n") . '/index.php', 2, _NOPERM); - exit(); + $xoops->redirect(XOOPS_URL . '/modules/' . $xoops->module->getVar("dirname", "n") . '/index.php', 2, _NOPERM); } if (is_object($pm) && !empty($_POST['action']) ) { - if (!$GLOBALS['xoopsSecurity']->check()) { - echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()); + if (!$xoops->security->check()) { + echo implode('<br />', $xoops->security->getErrors()); exit(); } $res = false; if (!empty($_REQUEST['email_message'])) { - $res = $pm_handler->sendEmail($pm, $GLOBALS['xoopsUser']); + $res = $pm_handler->sendEmail($pm, $xoops->user); } else if (!empty($_REQUEST['move_message']) && $_REQUEST['op'] != 'save' - && !$GLOBALS['xoopsUser']->isAdmin() - && $pm_handler->getSavecount() >= $GLOBALS['xoopsModuleConfig']['max_save'] + && !$xoops->user->isAdmin() + && $pm_handler->getSavecount() >= $xoops->getModuleConfig('max_save') ) { - $res_message = sprintf(_PM_SAVED_PART, $GLOBALS['xoopsModuleConfig']['max_save'], 0); + $res_message = sprintf(_PM_SAVED_PART, $xoops->getModuleConfig('max_save'), 0); } else { switch ($_REQUEST['op']) { case 'out': - if ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) break; + if ($pm->getVar('from_userid') != $xoops->user->getVar('uid')) break; if (!empty($_REQUEST['delete_message'])) { $res = $pm_handler->setFromdelete($pm); } else if (!empty($_REQUEST['move_message'])) { @@ -67,7 +69,7 @@ } break; case 'save': - if ($pm->getVar('to_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { + if ($pm->getVar('to_userid') == $xoops->user->getVar('uid')) { if (!empty($_REQUEST['delete_message'])) { $res1 = $pm_handler->setTodelete($pm); $res1 = ($res1) ? $pm_handler->setTosave($pm, 0) : false; @@ -75,7 +77,7 @@ $res1 = $pm_handler->setTosave($pm, 0); } } - if ($pm->getVar('from_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { + if ($pm->getVar('from_userid') == $xoops->user->getVar('uid')) { if (!empty($_REQUEST['delete_message'])) { $res2 = $pm_handler->setFromDelete($pm); $res2 = ($res2) ? $pm_handler->setFromsave($pm, 0) : false; @@ -88,7 +90,7 @@ case 'in': default: - if ($pm->getVar('to_userid') != $GLOBALS['xoopsUser']->getVar('uid')) { + if ($pm->getVar('to_userid') != $xoops->user->getVar('uid')) { break; } if (!empty($_REQUEST['delete_message'])) { @@ -109,20 +111,20 @@ if (!is_object($pm)) { if ($_REQUEST['op'] == "out") { $criteria = new CriteriaCompo(new Criteria('from_delete', 0)); - $criteria->add(new Criteria('from_userid', $GLOBALS['xoopsUser']->getVar('uid'))); + $criteria->add(new Criteria('from_userid', $xoops->user->getVar('uid'))); $criteria->add(new Criteria('from_save', 0)); } else if ($_REQUEST['op'] == "save") { $crit_to = new CriteriaCompo(new Criteria('to_delete', 0)); $crit_to->add(new Criteria('to_save', 1)); - $crit_to->add(new Criteria('to_userid',$GLOBALS['xoopsUser']->getVar('uid'))); + $crit_to->add(new Criteria('to_userid',$xoops->user->getVar('uid'))); $crit_from = new CriteriaCompo(new Criteria('from_delete', 0)); $crit_from->add(new Criteria('from_save', 1)); - $crit_from->add(new Criteria('from_userid', $GLOBALS['xoopsUser']->getVar('uid'))); + $crit_from->add(new Criteria('from_userid', $xoops->user->getVar('uid'))); $criteria = new CriteriaCompo($crit_to); $criteria->add($crit_from, "OR"); } else { $criteria = new CriteriaCompo(new Criteria('to_delete', 0)); - $criteria->add(new Criteria('to_userid', $GLOBALS['xoopsUser']->getVar('uid'))); + $criteria->add(new Criteria('to_userid', $xoops->user->getVar('uid'))); $criteria->add(new Criteria('to_save', 0)); } @@ -135,7 +137,7 @@ $pmform = new XoopsThemeForm('', 'pmform', 'readpmsg.php', 'post', true); if (is_object($pm) && !empty($pm)) { - if ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) { + if ($pm->getVar('from_userid') != $xoops->user->getVar('uid')) { $reply_button = new XoopsFormButton('', 'send', _PM_REPLY); $reply_button->setExtra("onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/modules/pm/pmlite.php?reply=1&msg_id={$msg_id}\", \"pmlite\", 565,500);'"); $pmform->addElement($reply_button); @@ -146,31 +148,31 @@ $pmform->addElement(new XoopsFormHidden('msg_id', $pm->getVar("msg_id"))); $pmform->addElement(new XoopsFormHidden('op', $_REQUEST['op'])); $pmform->addElement(new XoopsFormHidden('action', 1)); - $pmform->assign($GLOBALS['xoopsTpl']); + $pmform->assign($xoops->tpl); - if ($pm->getVar("from_userid") == $GLOBALS['xoopsUser']->getVar("uid")) { + if ($pm->getVar("from_userid") == $xoops->user->getVar("uid")) { $poster = new XoopsUser($pm->getVar("to_userid")); } else { $poster = new XoopsUser($pm->getVar("from_userid")); } if (!is_object($poster)) { - $GLOBALS['xoopsTpl']->assign('poster', false); - $GLOBALS['xoopsTpl']->assign('anonymous', $xoopsConfig['anonymous']); + $xoops->tpl->assign('poster', false); + $xoops->tpl->assign('anonymous', $xoopsConfig['anonymous']); } else { - $GLOBALS['xoopsTpl']->assign('poster', $poster); + $xoops->tpl->assign('poster', $poster); } - if ($pm->getVar("to_userid") == $GLOBALS['xoopsUser']->getVar("uid") && $pm->getVar('read_msg') == 0) { + if ($pm->getVar("to_userid") == $xoops->user->getVar("uid") && $pm->getVar('read_msg') == 0) { $pm_handler->setRead($pm); } $message = $pm->getValues(); $message['msg_time'] = XoopsLocal::formatTimestamp($pm->getVar("msg_time")); } -$GLOBALS['xoopsTpl']->assign('message', $message); -$GLOBALS['xoopsTpl']->assign('op', $_REQUEST['op']); -$GLOBALS['xoopsTpl']->assign('previous', $start - 1); -$GLOBALS['xoopsTpl']->assign('next', $start + 1); -$GLOBALS['xoopsTpl']->assign('total_messages', $total_messages); +$xoops->tpl->assign('message', $message); +$xoops->tpl->assign('op', $_REQUEST['op']); +$xoops->tpl->assign('previous', $start - 1); +$xoops->tpl->assign('next', $start + 1); +$xoops->tpl->assign('total_messages', $total_messages); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php 2011-11-16 17:49:29 UTC (rev 8305) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php 2011-11-16 20:46:43 UTC (rev 8306) @@ -1,14 +1,17 @@ <?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. +*/ + /** * Private message 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. - * 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm @@ -21,172 +24,197 @@ include_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -if (!is_object($GLOBALS['xoopsUser'])) { +if (!$xoops->isUser()) { $xoops->redirect(XOOPS_URL, 3, _NOPERM); - exit(); } + $xoops->disableModuleCache(); //disable caching since the URL will be the same, but content different from one user to another $xoops->header('pm_viewpmsg.html'); $valid_op_requests = array('out', 'save', 'in'); -$_REQUEST['op'] = !empty($_REQUEST['op']) && in_array($_REQUEST['op'], $valid_op_requests) ? $_REQUEST['op'] : 'in' ; +$_REQUEST['op'] = !empty($_REQUEST['op']) && in_array($_REQUEST['op'], $valid_op_requests) ? $_REQUEST['op'] : 'in'; $start = empty($_REQUEST["start"]) ? 0 : intval($_REQUEST["start"]); +/* @var $pm_handler PmMessageHandler */ $pm_handler = $xoops->getModuleHandler('message'); if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) { - if (!$GLOBALS['xoopsSecurity']->check()) { - ... [truncated message content] |
From: <ma...@us...> - 2011-12-04 15:34:59
|
Revision: 8405 http://xoops.svn.sourceforge.net/xoops/?rev=8405&view=rev Author: mageg Date: 2011-12-04 15:34:52 +0000 (Sun, 04 Dec 2011) Log Message: ----------- Rename admin.php in index.php Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.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/pm/xoops_version.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/index.php Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/admin.php Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/admin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/admin.php 2011-12-04 15:29:00 UTC (rev 8404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/admin.php 2011-12-04 15:34:52 UTC (rev 8405) @@ -1,33 +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. -*/ - -/** - * Private Message - * - * @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 pm - * @since 2.5.0 - * @author Mage - * @author Mamba - * @version $Id$ - */ - -include dirname(__FILE__) . '/header.php'; - -$xoops = Xoops::getInstance(); -$xoops->header(); - -$indexAdmin = new ModuleAdmin(); -echo $indexAdmin->addNavigation('admin.php'); -echo $indexAdmin->renderIndex(); - -$xoops->footer(); \ No newline at end of file Copied: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/index.php (from rev 8404, XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/admin.php) =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/index.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/index.php 2011-12-04 15:34:52 UTC (rev 8405) @@ -0,0 +1,33 @@ +<?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. +*/ + +/** + * Private Message + * + * @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 pm + * @since 2.5.0 + * @author Mage + * @author Mamba + * @version $Id$ + */ + +include dirname(__FILE__) . '/header.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); + +$indexAdmin = new ModuleAdmin(); +echo $indexAdmin->addNavigation('admin.php'); +echo $indexAdmin->renderIndex(); + +$xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.php 2011-12-04 15:29:00 UTC (rev 8404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.php 2011-12-04 15:34:52 UTC (rev 8405) @@ -26,7 +26,7 @@ $i = 1; $adminmenu[$i]['title'] = _PM_MI_INDEX; -$adminmenu[$i]['link'] = "admin/admin.php"; +$adminmenu[$i]['link'] = "admin/index.php"; $adminmenu[$i]['icon'] = '../../' . $pathIcon32 . '/home.png'; $i++; $adminmenu[$i]['title'] = _PM_MI_PRUNE; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php 2011-12-04 15:29:00 UTC (rev 8404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php 2011-12-04 15:34:52 UTC (rev 8405) @@ -86,7 +86,7 @@ $xoops->footer(); } } - $xoops->redirect('admin.php', 2, sprintf(_PM_AM_MESSAGESPRUNED, $deletedrows)); + $xoops->redirect('index.php', 2, sprintf(_PM_AM_MESSAGESPRUNED, $deletedrows)); break; } $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php 2011-12-04 15:29:00 UTC (rev 8404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php 2011-12-04 15:34:52 UTC (rev 8405) @@ -42,7 +42,8 @@ $modversion["module_website_name"] = "XOOPS"; $modversion["module_status"] = "RC"; $modversion['min_php'] = '5.2'; -$modversion['min_xoops'] = "2.5.0"; +$modversion['min_xoops'] = "2.6.0"; +$modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); // Admin menu // Set to 1 if you want to display menu generated by system module This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2011-12-04 20:29:45
|
Revision: 8409 http://xoops.svn.sourceforge.net/xoops/?rev=8409&view=rev Author: mageg Date: 2011-12-04 20:29:39 +0000 (Sun, 04 Dec 2011) Log Message: ----------- Update module pm to use XoopsModuleAdmin Modified Paths: -------------- 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/header.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/menu.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/pm/xoops_version.php Modified: 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/about.php 2011-12-04 20:28:48 UTC (rev 8408) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/about.php 2011-12-04 20:29:39 UTC (rev 8409) @@ -26,7 +26,7 @@ $xoops = Xoops::getInstance(); $xoops->header(); -$aboutAdmin = new ModuleAdmin(); +$aboutAdmin = new XoopsModuleAdmin(); echo $aboutAdmin->addNavigation('about.php'); echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/header.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/header.php 2011-12-04 20:28:48 UTC (rev 8408) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/header.php 2011-12-04 20:29:39 UTC (rev 8409) @@ -22,10 +22,4 @@ require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; -$xoops = Xoops::getInstance(); - -if (file_exists($xoops->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))) { - include_once $xoops->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); -} else { - echo $xoops->error("Error: You don't use the Frameworks \"admin module\". Please install this Frameworks"); -} \ No newline at end of file +$xoops = Xoops::getInstance(); \ No newline at end of file Modified: 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/index.php 2011-12-04 20:28:48 UTC (rev 8408) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/index.php 2011-12-04 20:29:39 UTC (rev 8409) @@ -26,7 +26,7 @@ $xoops = Xoops::getInstance(); $xoops->header(); -$indexAdmin = new ModuleAdmin(); +$indexAdmin = new XoopsModuleAdmin(); echo $indexAdmin->addNavigation('admin.php'); echo $indexAdmin->renderIndex(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.php 2011-12-04 20:28:48 UTC (rev 8408) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/menu.php 2011-12-04 20:29:39 UTC (rev 8409) @@ -20,19 +20,19 @@ * @version $Id$ */ -$pathIcon32 = Xoops::getInstance()->getHandlerModule()->getByDirname('pm')->getInfo('icons32'); +$pathIcon32 = '../../media/xoops/images/icons/32/'; $adminmenu = array(); $i = 1; $adminmenu[$i]['title'] = _PM_MI_INDEX; $adminmenu[$i]['link'] = "admin/index.php"; -$adminmenu[$i]['icon'] = '../../' . $pathIcon32 . '/home.png'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/home.png'; $i++; $adminmenu[$i]['title'] = _PM_MI_PRUNE; $adminmenu[$i]['link'] = "admin/prune.php"; -$adminmenu[$i]['icon'] = '../../' . $pathIcon32 . '/prune.png'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/prune.png'; $i++; $adminmenu[$i]['title'] = _PM_MI_ABOUT; $adminmenu[$i]['link'] = 'admin/about.php'; -$adminmenu[$i]['icon'] = '../../' . $pathIcon32 . '/about.png'; \ No newline at end of file +$adminmenu[$i]['icon'] = $pathIcon32 . '/about.png'; \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php 2011-12-04 20:28:48 UTC (rev 8408) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php 2011-12-04 20:29:39 UTC (rev 8409) @@ -25,7 +25,7 @@ $xoops = Xoops::getInstance(); $xoops->header(); -$indexAdmin = new ModuleAdmin(); +$indexAdmin = new XoopsModuleAdmin(); echo $indexAdmin->addNavigation('prune.php'); $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : "form"; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php 2011-12-04 20:28:48 UTC (rev 8408) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php 2011-12-04 20:29:39 UTC (rev 8409) @@ -51,7 +51,7 @@ // Admin things $modversion['hasAdmin'] = 1; -$modversion['adminindex'] = "admin/admin.php"; +$modversion['adminindex'] = "admin/index.php"; $modversion['adminmenu'] = "admin/menu.php"; // Mysql file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <for...@us...> - 2012-01-04 14:33:27
|
Revision: 8636 http://xoops.svn.sourceforge.net/xoops/?rev=8636&view=rev Author: forxoops Date: 2012-01-04 14:33:18 +0000 (Wed, 04 Jan 2012) Log Message: ----------- Change module logo and add module icons Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/images/logo.png Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/logo_large.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/logo_small.png Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/index.html 2012-01-04 14:33:18 UTC (rev 8636) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/logo_large.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/logo_large.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/logo_small.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/icons/logo_small.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/images/logo.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |