From: <du...@us...> - 2012-10-07 11:33:53
|
Revision: 10196 http://sourceforge.net/p/xoops/svn/10196 Author: dugris Date: 2012-10-07 11:33:50 +0000 (Sun, 07 Oct 2012) Log Message: ----------- Keep toArray() function for the compatibility of modules, and customization of classes Modified Paths: -------------- 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/kernel/object.php Property Changed: ---------------- 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/kernel/object.php 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-10-05 13:24:54 UTC (rev 10195) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php 2012-10-07 11:33:50 UTC (rev 10196) @@ -1,216 +1,216 @@ -<?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. -*/ - -/** - * Object joint handler class. - * - * @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 - * @subpackage model - * @since 2.3.0 - * @author Taiwen Jiang <ph...@us...> - * @version $Id$ - */ - -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Object joint handler class. - * - * @author Taiwen Jiang <ph...@us...> - * - * {@link XoopsObjectAbstract} - * - * Usage of methods provided by XoopsModelJoint: - * - * Step #1: set linked table and adjoint fields through XoopsPersistableObjectHandler: - * $handler->table_link = $handler->db->prefix("the_linked_table"); // full name of the linked table that is used for the query - * $handler->field_link = "the_linked_field"; // name of field in linked table that will be used to link the linked table with current table - * $handler->field_object = "the_object_field"; // name of field in current table that will be used to link the linked table with current table; linked field name will be used if the field name is not set - * Step #2: fetch data - */ -class XoopsModelJoint extends XoopsModelAbstract -{ - /** - * Validate information for the linkship - * - * @access private - * @return bool|null - */ - private function validateLinks() - { - if (empty($this->handler->table_link) || empty($this->handler->field_link)) { - trigger_error("The linked table is not set yet.", E_USER_WARNING); - return null; - } - if (empty($this->handler->field_object)) { - $this->handler->field_object = $this->handler->field_link; - } - return true; - } - - /** - * get a list of objects matching a condition joint with another related object - * - * @param CriteriaElement|null $criteria {@link CriteriaElement} to match - * @param array $fields variables to fetch - * @param bool $asObject flag indicating as object, otherwise as array - * @param string $field_link field of linked object for JOIN; deprecated, for backward compat - * @param string $field_object field of current object for JOIN; deprecated, for backward compat - * @return array of objects {@link XoopsObject} - */ - public function getByLink(CriteriaElement $criteria = null, $fields = null, $asObject = true, $field_link = null, $field_object = null) - { - if (!empty($field_link)) { - $this->handler->field_link = $field_link; - } - if (!empty($field_object)) { - $this->handler->field_object = $field_object; - } - if (!$this->validateLinks()) { - return null; - } - - if (is_array($fields) && count($fields)) { - if (!in_array("o." . $this->handler->keyName, $fields)) { - $fields[] = "o." . $this->handler->keyName; - } - $select = implode(",", $fields); - } else { - $select = "o.*, l.*"; - } - $limit = null; - $start = null; - // $field_object = empty($field_object) ? $field_link : $field_object; - $sql = " SELECT {$select}" . " 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 ($sort = $criteria->getSort()) { - $sql .= " ORDER BY {$sort} " . $criteria->getOrder(); - $orderSet = true; - } - $limit = $criteria->getLimit(); - $start = $criteria->getStart(); - } - if (empty($orderSet)) { - $sql .= " ORDER BY o.{$this->handler->keyName} DESC"; - } - $result = $this->handler->db->query($sql, $limit, $start); - $ret = array(); - if ($asObject) { - while ($myrow = $this->handler->db->fetchArray($result)) { - $object = $this->handler->create(false); - $object->assignVars($myrow); - $ret[$myrow[$this->handler->keyName]] = $object; - unset($object); - } - } else { - $object = $this->handler->create(false); - while ($myrow = $this->handler->db->fetchArray($result)) { - $object->assignVars($myrow); - $ret[$myrow[$this->handler->keyName]] = $object->getValues(array_keys($myrow)); - } - unset($object); - } - return $ret; - } - - /** - * Count of objects matching a condition - * - * @param CriteriaElement|null $criteria {@link CriteriaElement} to match - * @return int count of objects - */ - public function getCountByLink(CriteriaElement $criteria = null) - { - if (!$this->validateLinks()) { - return null; - } - - $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 (!$result = $this->handler->db->query($sql)) { - return false; - } - $myrow = $this->handler->db->fetchArray($result); - return intval($myrow["count"]); - } - - /** - * array of count of objects matching a condition of, groupby linked object keyname - * - * @param CriteriaElement $criteria {@link CriteriaElement} to match - * @return int count of objects - */ - public function getCountsByLink(CriteriaElement $criteria = null) - { - if (!$this->validateLinks()) { - return null; - } - $sql = " SELECT l.{$this->handler->keyName_link}, 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(); - } - $sql .= " GROUP BY l.{$this->handler->keyName_link}"; - if (!$result = $this->handler->db->query($sql)) { - return false; - } - $ret = array(); - while (list ($id, $count) = $this->handler->db->fetchRow($result)) { - $ret[$id] = $count; - } - return $ret; - } - - /** - * update objects matching a condition against linked objects - * - * @param array $data array of key => value - * @param CriteriaElement|null $criteria {@link CriteriaElement} to match - * @return int count of objects - */ - public function updateByLink($data, CriteriaElement $criteria = null) - { - if (!$this->validateLinks()) { - return null; - } - $set = array(); - foreach ($data as $key => $val) { - $set[] = "o.{$key}=" . $this->handler->db->quoteString($val); - } - $sql = " UPDATE {$this->handler->table} AS o" . " SET " . implode(", ", $set) . " 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(); - } - return $this->handler->db->query($sql); - } - - /** - * Delete objects matching a condition against linked objects - * - * @param CriteriaElement|null $criteria {@link CriteriaElement} to match - * @return int count of objects - */ - public function deleteByLink(CriteriaElement $criteria = null) - { - if (!$this->validateLinks()) { - return null; - } - $sql = "DELETE 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(); - } - return $this->handler->db->query($sql); - } +<?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. +*/ + +/** + * Object joint handler class. + * + * @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 + * @subpackage model + * @since 2.3.0 + * @author Taiwen Jiang <ph...@us...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * Object joint handler class. + * + * @author Taiwen Jiang <ph...@us...> + * + * {@link XoopsObjectAbstract} + * + * Usage of methods provided by XoopsModelJoint: + * + * Step #1: set linked table and adjoint fields through XoopsPersistableObjectHandler: + * $handler->table_link = $handler->db->prefix("the_linked_table"); // full name of the linked table that is used for the query + * $handler->field_link = "the_linked_field"; // name of field in linked table that will be used to link the linked table with current table + * $handler->field_object = "the_object_field"; // name of field in current table that will be used to link the linked table with current table; linked field name will be used if the field name is not set + * Step #2: fetch data + */ +class XoopsModelJoint extends XoopsModelAbstract +{ + /** + * Validate information for the linkship + * + * @access private + * @return bool|null + */ + private function validateLinks() + { + if (empty($this->handler->table_link) || empty($this->handler->field_link)) { + trigger_error("The linked table is not set yet.", E_USER_WARNING); + return null; + } + if (empty($this->handler->field_object)) { + $this->handler->field_object = $this->handler->field_link; + } + return true; + } + + /** + * get a list of objects matching a condition joint with another related object + * + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match + * @param array $fields variables to fetch + * @param bool $asObject flag indicating as object, otherwise as array + * @param string $field_link field of linked object for JOIN; deprecated, for backward compat + * @param string $field_object field of current object for JOIN; deprecated, for backward compat + * @return array of objects {@link XoopsObject} + */ + public function getByLink(CriteriaElement $criteria = null, $fields = null, $asObject = true, $field_link = null, $field_object = null) + { + if (!empty($field_link)) { + $this->handler->field_link = $field_link; + } + if (!empty($field_object)) { + $this->handler->field_object = $field_object; + } + if (!$this->validateLinks()) { + return null; + } + + if (is_array($fields) && count($fields)) { + if (!in_array("o." . $this->handler->keyName, $fields)) { + $fields[] = "o." . $this->handler->keyName; + } + $select = implode(",", $fields); + } else { + $select = "o.*, l.*"; + } + $limit = null; + $start = null; + // $field_object = empty($field_object) ? $field_link : $field_object; + $sql = " SELECT {$select}" . " 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 ($sort = $criteria->getSort()) { + $sql .= " ORDER BY {$sort} " . $criteria->getOrder(); + $orderSet = true; + } + $limit = $criteria->getLimit(); + $start = $criteria->getStart(); + } + if (empty($orderSet)) { + $sql .= " ORDER BY o.{$this->handler->keyName} DESC"; + } + $result = $this->handler->db->query($sql, $limit, $start); + $ret = array(); + if ($asObject) { + while ($myrow = $this->handler->db->fetchArray($result)) { + $object = $this->handler->create(false); + $object->assignVars($myrow); + $ret[$myrow[$this->handler->keyName]] = $object; + unset($object); + } + } else { + $object = $this->handler->create(false); + while ($myrow = $this->handler->db->fetchArray($result)) { + $object->assignVars($myrow); + $ret[$myrow[$this->handler->keyName]] = $object->toArray(); + } + unset($object); + } + return $ret; + } + + /** + * Count of objects matching a condition + * + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match + * @return int count of objects + */ + public function getCountByLink(CriteriaElement $criteria = null) + { + if (!$this->validateLinks()) { + return null; + } + + $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 (!$result = $this->handler->db->query($sql)) { + return false; + } + $myrow = $this->handler->db->fetchArray($result); + return intval($myrow["count"]); + } + + /** + * array of count of objects matching a condition of, groupby linked object keyname + * + * @param CriteriaElement $criteria {@link CriteriaElement} to match + * @return int count of objects + */ + public function getCountsByLink(CriteriaElement $criteria = null) + { + if (!$this->validateLinks()) { + return null; + } + $sql = " SELECT l.{$this->handler->keyName_link}, 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(); + } + $sql .= " GROUP BY l.{$this->handler->keyName_link}"; + if (!$result = $this->handler->db->query($sql)) { + return false; + } + $ret = array(); + while (list ($id, $count) = $this->handler->db->fetchRow($result)) { + $ret[$id] = $count; + } + return $ret; + } + + /** + * update objects matching a condition against linked objects + * + * @param array $data array of key => value + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match + * @return int count of objects + */ + public function updateByLink($data, CriteriaElement $criteria = null) + { + if (!$this->validateLinks()) { + return null; + } + $set = array(); + foreach ($data as $key => $val) { + $set[] = "o.{$key}=" . $this->handler->db->quoteString($val); + } + $sql = " UPDATE {$this->handler->table} AS o" . " SET " . implode(", ", $set) . " 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(); + } + return $this->handler->db->query($sql); + } + + /** + * Delete objects matching a condition against linked objects + * + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match + * @return int count of objects + */ + public function deleteByLink(CriteriaElement $criteria = null) + { + if (!$this->validateLinks()) { + return null; + } + $sql = "DELETE 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(); + } + return $this->handler->db->query($sql); + } } \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php ___________________________________________________________________ Deleted: svn:eol-style - native 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-10-05 13:24:54 UTC (rev 10195) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php 2012-10-07 11:33:50 UTC (rev 10196) @@ -1,182 +1,182 @@ -<?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. -*/ - -/** - * Object render handler class. - * - * @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 - * @subpackage model - * @since 2.3.0 - * @author Taiwen Jiang <ph...@us...> - * @version $Id$ - */ - -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Object render handler class. - * - * @author Taiwen Jiang <ph...@us...> - * - * {@link XoopsObjectAbstract} - */ -class XoopsModelRead extends XoopsModelAbstract -{ - /** - * get all objects matching a condition - * - * @param CriteriaElement|null $criteria {@link CriteriaElement} to match - * @param array $fields variables to fetch - * @param bool $asObject flag indicating as object, otherwise as array - * @param bool $id_as_key use the ID as key for the array - * @return array of objects/array {@link XoopsObject} - */ - public function getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true) - { - if (is_array($fields) && count($fields) > 0) { - if (!in_array($this->handler->keyName, $fields)) { - $fields[] = $this->handler->keyName; - } - $select = "`" . implode("`, `", $fields) . "`"; - } else { - $select = "*"; - } - $limit = null; - $start = null; - $sql = "SELECT {$select} FROM `{$this->handler->table}`"; - if (isset($criteria)) { - $sql .= " " . $criteria->renderWhere(); - if ($groupby = $criteria->getGroupby()) { - $sql .= $groupby; - } - if ($sort = $criteria->getSort()) { - $sql .= " ORDER BY {$sort} " . $criteria->getOrder(); - $orderSet = true; - } - $limit = $criteria->getLimit(); - $start = $criteria->getStart(); - } - if (empty($orderSet)) { - //$sql .= " ORDER BY `{$this->handler->keyName}` DESC"; - } - $result = $this->handler->db->query($sql, $limit, $start); - $ret = array(); - if ($asObject) { - while ($myrow = $this->handler->db->fetchArray($result)) { - $object = $this->handler->create(false); - $object->assignVars($myrow); - if ($id_as_key) { - $ret[$myrow[$this->handler->keyName]] = $object; - } else { - $ret[] = $object; - } - unset($object); - } - } else { - $object = $this->handler->create(false); - while ($myrow = $this->handler->db->fetchArray($result)) { - $object->assignVars($myrow); - if ($id_as_key) { - $ret[$myrow[$this->handler->keyName]] = $object->getValues(array_keys($myrow)); - } else { - $ret[] = $object->getValues(array_keys($myrow)); - } - } - unset($object); - } - return $ret; - } - - /** - * retrieve objects from the database - * - * For performance consideration, getAll() is recommended - * - * @param CriteriaElement|null $criteria {@link CriteriaElement} conditions to be met - * @param bool $id_as_key use the ID as key for the array - * @param bool $as_object return an array of objects? - * @return array - */ - public function getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true) - { - $objects = $this->getAll($criteria, null, $as_object, $id_as_key); - return $objects; - } - - /** - * Retrieve a list of objects data - * - * @param CriteriaElement|null $criteria {@link CriteriaElement} conditions to be met - * @param int $limit Max number of objects to fetch - * @param int $start Which record to start at - * @return array - */ - public function getList(CriteriaElement $criteria = null, $limit = 0, $start = 0) - { - $ret = array(); - if ($criteria == null) { - $criteria = new CriteriaCompo(); - } - - $sql = "SELECT `{$this->handler->keyName}`"; - if (!empty($this->handler->identifierName)) { - $sql .= ", `{$this->handler->identifierName}`"; - } - $sql .= " FROM `{$this->handler->table}`"; - if (isset($criteria)) { - $sql .= ' ' . $criteria->renderWhere(); - if ($sort = $criteria->getSort()) { - $sql .= ' ORDER BY ' . $sort . ' ' . $criteria->getOrder(); - } - $limit = $criteria->getLimit(); - $start = $criteria->getStart(); - } - $result = $this->handler->db->query($sql, $limit, $start); - if (!$result) { - return $ret; - } - - $myts = MyTextSanitizer::getInstance(); - while ($myrow = $this->handler->db->fetchArray($result)) { - // identifiers should be textboxes, so sanitize them like that - $ret[$myrow[$this->handler->keyName]] = empty($this->handler->identifierName) ? 1 - : $myts->htmlSpecialChars($myrow[$this->handler->identifierName]); - } - return $ret; - } - - /** - * get IDs of objects matching a condition - * - * @param CriteriaElement|null $criteria {@link CriteriaElement} to match - * @return array of object IDs - */ - function getIds(CriteriaElement $criteria = null) - { - $ret = array(); - $sql = "SELECT `{$this->handler->keyName}` FROM `{$this->handler->table}`"; - $limit = $start = null; - if (isset($criteria)) { - $sql .= ' ' . $criteria->renderWhere(); - $limit = $criteria->getLimit(); - $start = $criteria->getStart(); - } - if (!$result = $this->handler->db->query($sql, $limit, $start)) { - return $ret; - } - while ($myrow = $this->handler->db->fetchArray($result)) { - $ret[] = $myrow[$this->handler->keyName]; - } - return $ret; - } +<?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. +*/ + +/** + * Object render handler class. + * + * @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 + * @subpackage model + * @since 2.3.0 + * @author Taiwen Jiang <ph...@us...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * Object render handler class. + * + * @author Taiwen Jiang <ph...@us...> + * + * {@link XoopsObjectAbstract} + */ +class XoopsModelRead extends XoopsModelAbstract +{ + /** + * get all objects matching a condition + * + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match + * @param array $fields variables to fetch + * @param bool $asObject flag indicating as object, otherwise as array + * @param bool $id_as_key use the ID as key for the array + * @return array of objects/array {@link XoopsObject} + */ + public function getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true) + { + if (is_array($fields) && count($fields) > 0) { + if (!in_array($this->handler->keyName, $fields)) { + $fields[] = $this->handler->keyName; + } + $select = "`" . implode("`, `", $fields) . "`"; + } else { + $select = "*"; + } + $limit = null; + $start = null; + $sql = "SELECT {$select} FROM `{$this->handler->table}`"; + if (isset($criteria)) { + $sql .= " " . $criteria->renderWhere(); + if ($groupby = $criteria->getGroupby()) { + $sql .= $groupby; + } + if ($sort = $criteria->getSort()) { + $sql .= " ORDER BY {$sort} " . $criteria->getOrder(); + $orderSet = true; + } + $limit = $criteria->getLimit(); + $start = $criteria->getStart(); + } + if (empty($orderSet)) { + //$sql .= " ORDER BY `{$this->handler->keyName}` DESC"; + } + $result = $this->handler->db->query($sql, $limit, $start); + $ret = array(); + if ($asObject) { + while ($myrow = $this->handler->db->fetchArray($result)) { + $object = $this->handler->create(false); + $object->assignVars($myrow); + if ($id_as_key) { + $ret[$myrow[$this->handler->keyName]] = $object; + } else { + $ret[] = $object; + } + unset($object); + } + } else { + $object = $this->handler->create(false); + while ($myrow = $this->handler->db->fetchArray($result)) { + $object->assignVars($myrow); + if ($id_as_key) { + $ret[$myrow[$this->handler->keyName]] = $object->toArray(); + } else { + $ret[] = $object->toArray(); + } + } + unset($object); + } + return $ret; + } + + /** + * retrieve objects from the database + * + * For performance consideration, getAll() is recommended + * + * @param CriteriaElement|null $criteria {@link CriteriaElement} conditions to be met + * @param bool $id_as_key use the ID as key for the array + * @param bool $as_object return an array of objects? + * @return array + */ + public function getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true) + { + $objects = $this->getAll($criteria, null, $as_object, $id_as_key); + return $objects; + } + + /** + * Retrieve a list of objects data + * + * @param CriteriaElement|null $criteria {@link CriteriaElement} conditions to be met + * @param int $limit Max number of objects to fetch + * @param int $start Which record to start at + * @return array + */ + public function getList(CriteriaElement $criteria = null, $limit = 0, $start = 0) + { + $ret = array(); + if ($criteria == null) { + $criteria = new CriteriaCompo(); + } + + $sql = "SELECT `{$this->handler->keyName}`"; + if (!empty($this->handler->identifierName)) { + $sql .= ", `{$this->handler->identifierName}`"; + } + $sql .= " FROM `{$this->handler->table}`"; + if (isset($criteria)) { + $sql .= ' ' . $criteria->renderWhere(); + if ($sort = $criteria->getSort()) { + $sql .= ' ORDER BY ' . $sort . ' ' . $criteria->getOrder(); + } + $limit = $criteria->getLimit(); + $start = $criteria->getStart(); + } + $result = $this->handler->db->query($sql, $limit, $start); + if (!$result) { + return $ret; + } + + $myts = MyTextSanitizer::getInstance(); + while ($myrow = $this->handler->db->fetchArray($result)) { + // identifiers should be textboxes, so sanitize them like that + $ret[$myrow[$this->handler->keyName]] = empty($this->handler->identifierName) ? 1 + : $myts->htmlSpecialChars($myrow[$this->handler->identifierName]); + } + return $ret; + } + + /** + * get IDs of objects matching a condition + * + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match + * @return array of object IDs + */ + function getIds(CriteriaElement $criteria = null) + { + $ret = array(); + $sql = "SELECT `{$this->handler->keyName}` FROM `{$this->handler->table}`"; + $limit = $start = null; + if (isset($criteria)) { + $sql .= ' ' . $criteria->renderWhere(); + $limit = $criteria->getLimit(); + $start = $criteria->getStart(); + } + if (!$result = $this->handler->db->query($sql, $limit, $start)) { + return $ret; + } + while ($myrow = $this->handler->db->fetchArray($result)) { + $ret[] = $myrow[$this->handler->keyName]; + } + return $ret; + } } \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php ___________________________________________________________________ Deleted: svn:eol-style - native 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-10-05 13:24:54 UTC (rev 10195) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2012-10-07 11:33:50 UTC (rev 10196) @@ -1,1308 +1,1313 @@ -<?php -/** - * XOOPS Kernel Object - * - * 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 kernel - * @since 2.0.0 - * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ - * @author Taiwen Jiang <ph...@us...> - * @version $Id$ - */ - -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * *#@+ - * Xoops object datatype - */ -define('XOBJ_DTYPE_TXTBOX', 1); -define('XOBJ_DTYPE_TXTAREA', 2); -define('XOBJ_DTYPE_INT', 3); -define('XOBJ_DTYPE_URL', 4); -define('XOBJ_DTYPE_EMAIL', 5); -define('XOBJ_DTYPE_ARRAY', 6); -define('XOBJ_DTYPE_OTHER', 7); -define('XOBJ_DTYPE_SOURCE', 8); -define('XOBJ_DTYPE_STIME', 9); -define('XOBJ_DTYPE_MTIME', 10); -define('XOBJ_DTYPE_LTIME', 11); -define('XOBJ_DTYPE_FLOAT', 13); -define('XOBJ_DTYPE_DECIMAL', 14); -define('XOBJ_DTYPE_ENUM', 15); - -/** - * Base class for all objects in the Xoops kernel (and beyond) - */ -class XoopsObject -{ - /** - * holds all variables(properties) of an object - * - * @var array - */ - public $vars = array(); - - /** - * variables cleaned for store in DB - * - * @var array - */ - public $cleanVars = array(); - - /** - * is it a newly created object? - * - * @var bool - */ - private $_isNew = false; - - /** - * has any of the values been modified? - * - * @var bool - */ - private $_isDirty = false; - - /** - * errors - * - * @var array - */ - private $_errors = array(); - - /** - * additional filters registered dynamically by a child class object - * - * @var array - */ - private $_filters = array(); - - /** - * @var string - */ - public $plugin_path; - - /** - * used for new/clone objects - * - * @access public - * @return void - */ - public function setNew() - { - $this->_isNew = true; - } - - /** - * @return void - */ - public function unsetNew() - { - $this->_isNew = false; - } - - /** - * @return bool - */ - public function isNew() - { - return $this->_isNew; - } - - /** - * mark modified objects as dirty - * - * used for modified objects only - * - * @access public - * @return void - */ - public function setDirty() - { - $this->_isDirty = true; - } - - /** - * @return void - */ - public function unsetDirty() - { - $this->_isDirty = false; - } - - /** - * @return bool - */ - public function isDirty() - { - return $this->_isDirty; - } - - /** - * initialize variables for the object - * - * @param string $key - * @param int $data_type set to one of XOBJ_DTYPE_XXX constants (set to XOBJ_DTYPE_OTHER if no data type ckecking nor text sanitizing is required) - * @param mixed $value - * @param bool $required require html form input? - * @param mixed $maxlength for XOBJ_DTYPE_TXTBOX type only - * @param string $options does this data have any select options? - * @return void - */ - public function initVar($key, $data_type, $value = null, $required = false, $maxlength = null, $options = '') - { - $this->vars[$key] = array('value' => $value, 'required' => $required, 'data_type' => $data_type, 'maxlength' => $maxlength, 'changed' => false, 'options' => $options); - } - - /** - * assign a value to a variable - * - * @param string $key name of the variable to assign - * @param mixed $value value to assign - */ - public function assignVar($key, $value) - { - if (isset($key) && isset($this->vars[$key])) { - $this->vars[$key]['value'] = $value; - } - } - - /** - * assign values to multiple variables in a batch - * - * @param array $var_arr associative array of values to assign - */ - public function assignVars($var_arr) - { - foreach ($var_arr as $key => $value) { - $this->assignVar($key, $value); - } - } - - /** - * assign a value to a variable - * - * @access public - * @param string $key name of the variable to assign - * @param mixed $value value to assign - * @param bool $not_gpc - */ - public function setVar($key, $value, $not_gpc = false) - { - if (!empty($key) && isset($value) && isset($this->vars[$key])) { - $this->vars[$key]['value'] = $value; - $this->vars[$key]['not_gpc'] = $not_gpc; - $this->vars[$key]['changed'] = true; - $this->setDirty(); - } - } - - /** - * assign values to multiple variables in a batch - * - * @access private - * @param array $var_arr associative array of values to assign - * @param bool $not_gpc - */ - public function setVars($var_arr, $not_gpc = false) - { - foreach ($var_arr as $key => $value) { - $this->setVar($key, $value, $not_gpc); - } - } - - /** - * unset variable(s) for the object - * - * @param mixed $var - * @return bool - */ - public function destroyVars($var) - { - if (empty($var)) { - return true; - } - $var = !is_array($var) ? array($var) : $var; - foreach ($var as $key) { - if (!isset($this->vars[$key])) { - continue; - } - $this->vars[$key]['changed'] = null; - } - return true; - } - - /** - * Assign values to multiple variables in a batch - * - * Meant for a CGI context: - * - prefixed CGI args are considered save - * - avoids polluting of namespace with CGI args - * - * @access private - * @param mixed $var_arr associative array of values to assign - * @param string $pref prefix (only keys starting with the prefix will be set) - * @param bool $not_gpc - */ - public function setFormVars($var_arr = null, $pref = 'xo_', $not_gpc = false) - { - $len = strlen($pref); - foreach ($var_arr as $key => $value) { - if ($pref == substr($key, 0, $len)) { - $this->setVar(substr($key, $len), $value, $not_gpc); - } - } - } - - /** - * returns all variables for the object - * - * @access public - * @return array associative array of key->value pairs - */ - public function getVars() - { - return $this->vars; - } - - /** - * Returns the values of the specified variables - * - * @param mixed $keys An array containing the names of the keys to retrieve, or null to get all of them - * @param string $format Format to use (see getVar) - * @param int $maxDepth Maximum level of recursion to use if some vars are objects themselves - * @return array associative array of key->value pairs - */ - public function getValues($keys = null, $format = 's', $maxDepth = 1) - { - if (!isset($keys)) { - $keys = array_keys($this->vars); - } - $vars = array(); - foreach ($keys as $key) { - if (isset($this->vars[$key])) { - if (is_object($this->vars[$key]) && is_a($this->vars[$key], 'XoopsObject')) { - if ($maxDepth) { - /* @var $obj XoopsObject */ - $obj = $this->vars[$key]; - $vars[$key] = $obj->getValues(null, $format, $maxDepth - 1); - } - } else { - $vars[$key] = $this->getVar($key, $format); - } - } - } - return $vars; - } - - /** - * returns a specific variable for the object in a proper format - * - * @access public - * @param string $key key of the object's variable to be returned - * @param string $format format to use for the output - * @return mixed formatted value of the variable - */ - public function getVar($key, $format = 's') - { - $ret = null; - 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; - } - return $ret; - } - - /** - * clean values of all variables of the object for storage. - * also add slashes whereever needed - * - * @return bool true if successful - * @access public - */ - public function cleanVars() - { - $ts = MyTextSanitizer::getInstance(); - $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] = str_replace('\\"', '"', $cleanv); - unset($cleanv); - } - if (count($this->_errors) > 0) { - $this->_errors = array_merge($existing_errors, $this->_errors); - return false; - } - $this->_errors = array_merge($existing_errors, $this->_errors); - $this->unsetDirty(); - return true; - } - - /** - * dynamically register additional filter for the object - * - * @param string $filtername name of the filter - * @access public - */ - public function registerFilter($filtername) - { - $this->_filters[] = $filtername; - } - - /** - * load all additional filters that have been registered to the object - * - * @access private - */ - private function _loadFilters() - { - static $loaded; - if (isset($loaded)) { - return; - } - $loaded = 1; - - $path = empty($this->plugin_path) ? dirname(__FILE__) . '/filters' : $this->plugin_path; - if (file_exists($file = $path . '/filter.php')) { - include_once $file; - foreach ($this->_filters as $f) { - if (file_exists($file = $path . '/' . strtolower($f) . 'php')) { - include_once $file; - } - } - } - } - - /** - * load all local filters for the object - * - * Filter distribution: - * In each module folder there is a folder "filter" containing filter files with, - * filename: [name_of_target_class][.][function/action_name][.php]; - * function name: [dirname][_][name_of_target_class][_][function/action_name]; - * parameter: the target object - * - * @param string $method function or action name - * @access public - */ - public function loadFilters($method) - { - $this->_loadFilters(); - - - $class = get_class($this); - if (!$modules_active = XoopsCache::read('system_modules_active')) { - $xoops = Xoops::getInstance(); - $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'); - } - unset($modules_obj); - XoopsCache::write('system_modules_active', $modules_active); - } - foreach ($modules_active as $dirname) { - if (file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $dirname . '/filter/' . $class . '.' . $method . '.php')) { - include_once $file; - if (function_exists($class . '_' . $method)) { - call_user_func_array($dirname . '_' . $class . '_' . $method, array(&$this)); - } - } - } - } - - /** - * create a clone(copy) of the current object - * - * @access public - * @return object clone - */ - public function xoopsClone() - { - /* @var $clone XoopsObject */ - $class = get_class($this); - $clone = null; - $clone = new $class(); - foreach ($this->vars as $k => $v) { - $clone->assignVar($k, $v['value']); - } - // need this to notify the handler class that this is a newly created object - $clone->setNew(); - return $clone; - } - - /** - * add an error - * - * @param string $err_str to add - * @access public - */ - public function setErrors($err_str) - { - if (is_array($err_str)) { - $this->_errors = array_merge($this->_errors, $err_str); - } else { - $this->_errors[] = trim($err_str); - } - } - - /** - * return the errors for this object as an array - * - * @return array an array of errors - * @access public - */ - public function getErrors() - { - return $this->_errors; - } - - /** - * return the errors for this object as html - * - * @return string html listing the errors - * @access public - * @todo remove harcoded strings - */ - public function getHtmlErrors() - { - $ret = '<h4>Errors</h4>'; - if (!empty($this->_errors)) { - foreach ($this->_errors as $error) { - $ret .= $error . '<br />'; - } - } else { - $ret .= 'None<br />'; - } - return $ret; - } -} - -/** - * 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 - * - * @package kernel - * @abstract - * @author Kazumi Ono <on...@xo...> - * @copyright copyright © 2000 The XOOPS Project - */ -class XoopsObjectHandler -{ - /** - * holds referenced to {@link XoopsDatabase} class object - * - * @var XoopsDatabase - * @see XoopsDatabase - * @access protected - */ - public $db; - - /** - * called from child classes only - * - * @param XoopsDatabase $db reference to the {@link XoopsDatabase} object - * @access protected - */ - public function __construct($db) - { - $this->db = $db; - } - - /** - * creates a new object - * - * @abstract - */ - public function create() - { - - } - - /** - * gets a value object - * - * @param int $int_id - * @abstract - */ - public function get($int_id) - { - - } - - /** - * insert/update object - * - * @param object $object - * @abstract - */ - public function insert($object) - { - } - - /** - * delete object from database - * - * @param object $object - * @abstract - */ - public function delete($object) - { - } -} - -/** - * Persistable Object Handler class. - * - * @author Taiwen Jiang <ph...@us...> - * @author Jan Keller Pedersen <mit...@xo...> - * @copyright copyright (c) The XOOPS project - * @package kernel - */ -class XoopsPersistableObjectHandler extends XoopsObjectHandler -{ - /** - * holds reference to custom extended object handler - * - * var object - * - * @access private - */ - /** - * static protected - */ - protected $handler; - - /** - * holds reference to predefined extended object handlers: read, stats, joint, write, sync - * - * The handlers hold methods for different purposes, which could be all put together inside of current class. - * However, load codes only if they are necessary, thus they are now splitted out. - * - * var array of objects - * - * @access private - */ - private $handlers = array('read' => null, 'stats' => null, 'joint' => null, 'write' => null, 'sync' => null); - - /** - * Information about the class, the handler is managing - * - * @var string - * @access public - */ - public $table; - - /** - * @var string - */ - public $keyName; - - /** - * @var string - */ - public $className; - - /** - * @var string - */ - public $table_link; - - /** - * @var string - */ - public $identifierName; - - /** - * @var string - */ - public $field_link; - - /** - * @var string - */ - public $field_object; - - /** - * @var string - */ - public $keyName_link; - - /** - * Constructor - * - * @access protected - * @param null|XoopsDatabase $db {@link XoopsDatabase} object - * @param string $table Name of database table - * @param string $className Name of Class, this handler is managing - * @param string $keyName Name of the property holding the key - * @param string $identifierName Name of the property holding an identifier name (title, name ...), used on getList() - */ - public function __construct(XoopsDatabase $db = null, $table = '', $className = '', $keyName = '', $identifierName = '') - { - $db = XoopsDatabaseFactory::getDatabaseConnection(); - $table = $db->prefix($table); - parent::__construct($db); - $this->table = $table; - $this->keyName = $keyName; - $this->className = $className; - if ($identifierName) { - $this->identifierName = $identifierName; - } - } - - /** - * Set custom handler - * - * @access protected - * - * @param string|object $handler - * @param array|null $args - * @param string|null $path - * @return object|null - */ - public function setHandler($handler = null, $args = null, $path = null) - { - $this->handler = null; - if (is_object($handler)) { - $this->handler = $handler; - } else { - if (is_string($handler)) { - $xmf = XoopsModelFactory::getInstance(); - $this->handler = $xmf->loadHandler($this, $handler, $args, $path); - } - } -... [truncated message content] |
From: <du...@us...> - 2012-10-08 20:39:36
|
Revision: 10207 http://sourceforge.net/p/xoops/svn/10207 Author: dugris Date: 2012-10-08 20:39:33 +0000 (Mon, 08 Oct 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 XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/global.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php 2012-10-08 20:39:33 UTC (rev 10207) @@ -0,0 +1,131 @@ +<?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. +*/ + +/** + * XOOPS form element of text + * + * @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 + * @subpackage xoopsform + * @since 2.0.0 + * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * A simple text field + */ +class XoopsFormMail extends XoopsFormElement +{ + /** + * Size + * + * @var int + * @access private + */ + private $_size; + + /** + * Maximum length of the text + * + * @var int + * @access private + */ + + private $_maxlength; + + /** + * placeholder for this element + * + * @var string + * @access private + */ + private $_placeholder; + + /** + * Constructor + * + * @param string $caption Caption + * @param string $name "name" attribute + * @param int $size Size + * @param int $maxlength Maximum length of text + * @param string $value Initial text + * @param string $placeholder placeholder for this element. + */ + public function __construct($caption, $name, $size, $maxlength, $value = '', $placeholder = '') + { + $this->setCaption($caption); + $this->setName($name); + $this->_size = intval($size); + $this->_maxlength = intval($maxlength); + $this->setValue($value); + $this->_placeholder = $placeholder; + $this->setPattern('[^@]+@[^@]+\.[a-zA-Z]{2,6}', _FORM_VALID_MAIL); + } + + /** + * Get size + * + * @return int + */ + public function getSize() + { + return $this->_size; + } + + /** + * Get maximum text length + * + * @return int + */ + public function getMaxlength() + { + return $this->_maxlength; + } + + /** + * Get placeholder for this element + * + * @return string + */ + public function getPlaceholder() + { + if (empty($this->_placeholder)) { + return ''; + } + return $this->_placeholder; + } + + /** + * Prepare HTML for output + * + * @return string HTML + */ + public function render() + { + $name = $this->getName(); + if ($this->getSize() > $this->getMaxcols()) { + $maxcols = 5; + } else { + $maxcols = $this->getSize(); + } + $class = ($this->getClass() != '' ? " class='span" . $maxcols . " " . $this->getClass() . "'" : " class='span" . $maxcols . "'"); + $list = ($this->isDatalist() != '' ? " list='list_" . $name . "'" : ''); + $pattern = ($this->getPattern() != '' ? " pattern='" . $this->getPattern() . "'" : ''); + $placeholder = ($this->getPlaceholder() != '' ? " placeholder='" . $this->getPlaceholder() . "'" : ''); + $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); + $required = ($this->isRequired() ? ' required' : ''); + return "<input type='email' name='" . $name . "' title='" . $this->getTitle() . "' id='" . $name . "'" . $class ." maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $list . $pattern . $placeholder . $extra . $required . ">"; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php 2012-10-08 20:39:33 UTC (rev 10207) @@ -0,0 +1,131 @@ +<?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. +*/ + +/** + * XOOPS form element of text + * + * @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 + * @subpackage xoopsform + * @since 2.0.0 + * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * A simple text field + */ +class XoopsFormUrl extends XoopsFormElement +{ + /** + * Size + * + * @var int + * @access private + */ + private $_size; + + /** + * Maximum length of the text + * + * @var int + * @access private + */ + + private $_maxlength; + + /** + * placeholder for this element + * + * @var string + * @access private + */ + private $_placeholder; + + /** + * Constructor + * + * @param string $caption Caption + * @param string $name "name" attribute + * @param int $size Size + * @param int $maxlength Maximum length of text + * @param string $value Initial text + * @param string $placeholder placeholder for this element. + */ + public function __construct($caption, $name, $size, $maxlength, $value = '', $placeholder = '') + { + $this->setCaption($caption); + $this->setName($name); + $this->_size = intval($size); + $this->_maxlength = intval($maxlength); + $this->setValue($value); + $this->_placeholder = $placeholder; + $this->setPattern('https?://.+', _FORM_VALID_URL); + } + + /** + * Get size + * + * @return int + */ + public function getSize() + { + return $this->_size; + } + + /** + * Get maximum text length + * + * @return int + */ + public function getMaxlength() + { + return $this->_maxlength; + } + + /** + * Get placeholder for this element + * + * @return string + */ + public function getPlaceholder() + { + if (empty($this->_placeholder)) { + return ''; + } + return $this->_placeholder; + } + + /** + * Prepare HTML for output + * + * @return string HTML + */ + public function render() + { + $name = $this->getName(); + if ($this->getSize() > $this->getMaxcols()) { + $maxcols = 5; + } else { + $maxcols = $this->getSize(); + } + $class = ($this->getClass() != '' ? " class='span" . $maxcols . " " . $this->getClass() . "'" : " class='span" . $maxcols . "'"); + $list = ($this->isDatalist() != '' ? " list='list_" . $name . "'" : ''); + $pattern = ($this->getPattern() != '' ? " pattern='" . $this->getPattern() . "'" : ''); + $placeholder = ($this->getPlaceholder() != '' ? " placeholder='" . $this->getPlaceholder() . "'" : ''); + $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); + $required = ($this->isRequired() ? ' required' : ''); + return "<input type='url' name='" . $name . "' title='" . $this->getTitle() . "' id='" . $name . "'" . $class ." maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $list . $pattern . $placeholder . $extra . $required . ">"; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL 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-10-08 20:18:31 UTC (rev 10206) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-10-08 20:39:33 UTC (rev 10207) @@ -302,6 +302,8 @@ 'xoopsformtextarea' => XOOPS_ROOT_PATH . '/class/xoopsform/formtextarea.php', 'xoopsformtextdateselect' => XOOPS_ROOT_PATH . '/class/xoopsform/formtextdateselect.php', 'xoopsgroupformcheckbox' => XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php', + 'xoopsformmail' => XOOPS_ROOT_PATH . '/class/xoopsform/formmail.php', + 'xoopsformurl' => XOOPS_ROOT_PATH . '/class/xoopsform/formurl.php', 'xoopsgrouppermform' => XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php', 'xoopsguestuser' => XOOPS_ROOT_PATH . '/kernel/user.php', 'xoopsmailer' => XOOPS_ROOT_PATH . '/class/xoopsmailer.php', Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/global.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/global.php 2012-10-08 20:18:31 UTC (rev 10206) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/global.php 2012-10-08 20:39:33 UTC (rev 10207) @@ -108,7 +108,7 @@ define("_MD_STRTYOPENG","This can not be changed afterwards!"); define("_MD_ASFILE","Store as files (in uploads directory)"); define("_MD_INDB","Store in the database (as binary \"blob\" data)"); -define("_MD_IMGMAIN","Category"); +define("_MD_IMGMAIN","Category"); define("_MD_EDITIMGCAT","Images Settings"); define('_IMGMANAGER','Image Manager'); define('_NUMIMAGES','%s images'); @@ -213,4 +213,10 @@ **/ define('_RESET','Reset'); define('_RE','Re:'); + +/** +* Additions to 2.6.0 +**/ +define('_FORM_VALID_URL','Starting with http or https'); +define('_FORM_VALID_MAIL','Enter a valid email address'); ?> \ No newline at end of file |
From: <du...@us...> - 2012-10-15 17:32:47
|
Revision: 10216 http://sourceforge.net/p/xoops/svn/10216 Author: dugris Date: 2012-10-15 17:32:44 +0000 (Mon, 15 Oct 2012) Log Message: ----------- add $modversion['paypal'] in xoops_version.php for moduleadmin->renderAbout() Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_about.html 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-10-15 09:27:16 UTC (rev 10215) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-10-15 17:32:44 UTC (rev 10216) @@ -376,7 +376,7 @@ * @param string $paypal * @param bool $logo_xoops */ - public function renderAbout($paypal = '', $logo_xoops = true) + public function renderAbout($logo_xoops = true) { $xoops = Xoops::getInstance(); @@ -413,7 +413,9 @@ $this->_obj->setInfo('release_date', $release_date); $this->_obj->setInfo('author_list', $author_list); - $this->_obj->setInfo('paypal', $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); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_about.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_about.html 2012-10-15 09:27:16 UTC (rev 10215) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_about.html 2012-10-15 17:32:44 UTC (rev 10216) @@ -16,11 +16,17 @@ <div class="spacer marg5"><a href="http://<{$module->getInfo('website')}>" target="_blank"><{$module->getInfo('website')}></a></div> <{/if}> <{if $module->getInfo('paypal')}> - <form id="paypal-form" action="https://www.paypal.com/cgi-bin/webscr" method="post"> - <input type="hidden" name="cmd" value="_s-xclick"> - <input type="hidden" name="hosted_button_id" value="<{$module->getInfo('paypal')}>"> - <img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" onclick="$('#paypal-form').submit()" alt="PayPal - The safer, easier way to pay online!" /> - </form> + <form id="paypal-form" name="_xclick" action="https://www.paypal.com/fr/cgi-bin/webscr" method="post"> + <input type="hidden" name="cmd" value="_xclick"> + <{foreachq from=$module->getInfo('paypal') item=value key=key}> + <{if is_numeric($value)}> + <input type="hidden" name="<{$key}>" value=<{$value}>> + <{else}> + <input type="hidden" name="<{$key}>" value="<{$value}>"> + <{/if}> + <{/foreach}> + <img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" onclick="$('#paypal-form').submit()" alt="PayPal - The safer, easier way to pay online!" /> + </form> <{/if}> <{includeq file="admin:system|admin_infobox.html" class="width100"}> </td> |
From: <du...@us...> - 2012-10-20 00:13:54
|
Revision: 10228 http://sourceforge.net/p/xoops/svn/10228 Author: dugris Date: 2012-10-20 00:13:47 +0000 (Sat, 20 Oct 2012) Log Message: ----------- Fix for xlanguage Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/theme.html XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_user.html Added 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/include/common.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2012-10-18 12:42:23 UTC (rev 10227) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2012-10-20 00:13:47 UTC (rev 10228) @@ -300,4 +300,5 @@ $xoops->logger->stopTime('XOOPS Boot'); $xoops->logger->startTime('Module init'); -$xoops->preload->triggerEvent('core.include.common.end'); \ No newline at end of file +$xoops->preload->triggerEvent('core.include.common.end'); +$xoops->preload->triggerEvent('core.include.block.language'); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/theme.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/theme.html 2012-10-18 12:42:23 UTC (rev 10227) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/theme.html 2012-10-20 00:13:47 UTC (rev 10228) @@ -17,13 +17,15 @@ <{includeq file="$theme_tpl/theme_menu.html"}> <!-- User menu --> <{includeq file="$theme_tpl/theme_user.html"}> + <!-- Language menu --> + <{includeq file="$theme_tpl/theme_language.html"}> </div> </div> </div> <div class="xo-hero"> <div class="container xo-hero-content"> <div class="row"> - <div class="span7"> + <div class="span7"> <h1>XOOPS. Powered by You!</h1> <p>easy to use dynamic web content management system written in PHP</p> <p> @@ -147,8 +149,5 @@ </div> </div> </footer> -<script type="text/javascript"> - $().dropdown(); -</script> </body> </html> \ No newline at end of file Added: 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 (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_language.html 2012-10-20 00:13:47 UTC (rev 10228) @@ -0,0 +1,5 @@ +<{if constant($smarty.const.XLANGUAGE_THEME_ENABLE)}> + <div class="pull-right"> + <{$smarty.const.XLANGUAGE_SWITCH_CODE}> + </div> +<{/if}> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_user.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_user.html 2012-10-18 12:42:23 UTC (rev 10227) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_user.html 2012-10-20 00:13:47 UTC (rev 10228) @@ -66,5 +66,8 @@ </ul> </li> </ul> + <script type="text/javascript"> + $('.dropdown-toggle').dropdown(); + </script> <{/if}> </div> |
From: <du...@us...> - 2012-10-25 12:33:44
|
Revision: 10231 http://sourceforge.net/p/xoops/svn/10231 Author: dugris Date: 2012-10-25 12:33:41 +0000 (Thu, 25 Oct 2012) Log Message: ----------- Fix for xlanguage Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/language/english/main.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2012-10-22 07:38:25 UTC (rev 10230) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2012-10-25 12:33:41 UTC (rev 10231) @@ -399,6 +399,9 @@ // 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'); @@ -408,6 +411,9 @@ $this->preload->triggerEvent('core.header.addmeta'); + // load xlanguage block + $this->preload->triggerEvent('core.language.block'); + // 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); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2012-10-22 07:38:25 UTC (rev 10230) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2012-10-25 12:33:41 UTC (rev 10231) @@ -143,7 +143,6 @@ /** * Load Language settings and defines */ -$xoops->preload->triggerEvent('core.include.common.language'); $xoops->loadLanguage('global'); $xoops->loadLanguage('locale'); $xoops->loadLanguage('errors'); @@ -301,4 +300,3 @@ $xoops->logger->stopTime('XOOPS Boot'); $xoops->logger->startTime('Module init'); $xoops->preload->triggerEvent('core.include.common.end'); -$xoops->preload->triggerEvent('core.include.block.language'); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/language/english/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/language/english/main.php 2012-10-22 07:38:25 UTC (rev 10230) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/language/english/main.php 2012-10-25 12:33:41 UTC (rev 10231) @@ -36,4 +36,6 @@ define("_THEME_PM", "Inbox"); define("_THEME_LOGOUT", "Logout"); -define("_THEME_BACKTOP", "Back to top"); \ No newline at end of file +define("_THEME_BACKTOP", "Back to top"); + +define("_THEME_LANGUAGE", "Choose your language"); \ No newline at end of file |
From: <du...@us...> - 2012-10-29 18:30:51
|
Revision: 10242 http://sourceforge.net/p/xoops/svn/10242 Author: dugris Date: 2012-10-29 18:30:48 +0000 (Mon, 29 Oct 2012) Log Message: ----------- modify to use a custom file : xoops.bootstrap.css Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/mainfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/media/bootstrap/css/xoops.bootstrap.css XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_siteclosed.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/xotpl/head.html XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_head.html Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media/bootstrap/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media/bootstrap/css/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media/bootstrap/css/xoops.bootstrap.css XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media/ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media/bootstrap/ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media/bootstrap/css/ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media/bootstrap/css/xoops.bootstrap.css Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/mainfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/mainfile.php 2012-10-28 14:29:31 UTC (rev 10241) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/mainfile.php 2012-10-29 18:30:48 UTC (rev 10242) @@ -17,6 +17,65 @@ * @version $Id$ */ -if (! defined('XOOPS_INSTALL')) { - header('Location: install/index.php'); +if (!defined("XOOPS_MAINFILE_INCLUDED")) { + define("XOOPS_MAINFILE_INCLUDED", 1); + + // XOOPS Physical Paths + + // Physical path to the XOOPS documents (served) directory WITHOUT trailing slash + define('XOOPS_ROOT_PATH', 'C:/Internet/Xoops/Xoops_2.6.0/htdocs'); + + // For forward compatibility + // Physical path to the XOOPS library directory WITHOUT trailing slash + define('XOOPS_PATH', 'C:/Internet/Xoops/Xoops_2.6.0/htdocs/xoops_lib'); + // Physical path to the XOOPS datafiles (writable) directory WITHOUT trailing slash + define('XOOPS_VAR_PATH', 'C:/Internet/Xoops/Xoops_2.6.0/htdocs/xoops_data'); + // Alias of XOOPS_PATH, for compatibility, temporary solution + define("XOOPS_TRUST_PATH", XOOPS_PATH); + + // URL Association for SSL and Protocol Compatibility + $http = 'http://'; + if (!empty($_SERVER['HTTPS'])) { + $http = ($_SERVER['HTTPS']=='on') ? 'https://' : 'http://'; + } + define('XOOPS_PROT', $http); + + // XOOPS Virtual Path (URL) + // Virtual path to your main XOOPS directory WITHOUT trailing slash + // Example: define('XOOPS_URL', 'http://dugris.no-ip.org/Xoops/Xoops_2.6.0/htdocs'); + define('XOOPS_URL', 'http://dugris.no-ip.org:8090'); + + // Shall be handled later, don't forget! + define("XOOPS_CHECK_PATH", 0); + // Protect against external scripts execution if safe mode is not enabled + if (XOOPS_CHECK_PATH && !@ini_get("safe_mode")) { + if (function_exists("debug_backtrace")) { + $xoopsScriptPath = debug_backtrace(); + if (!count($xoopsScriptPath)) { + die("XOOPS path check: this file cannot be requested directly"); + } + $xoopsScriptPath = $xoopsScriptPath[0]["file"]; + } else { + $xoopsScriptPath = isset($_SERVER["PATH_TRANSLATED"]) ? $_SERVER["PATH_TRANSLATED"] : $_SERVER["SCRIPT_FILENAME"]; + } + if (DIRECTORY_SEPARATOR != "/") { + // IIS6 may double the \ chars + $xoopsScriptPath = str_replace(strpos($xoopsScriptPath, "\\\\", 2) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $xoopsScriptPath); + } + if (strcasecmp(substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace(DIRECTORY_SEPARATOR, "/", XOOPS_ROOT_PATH))) { + exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run."); + } + } + + // Secure file + require XOOPS_VAR_PATH . '/data/secure.php'; + + define('XOOPS_GROUP_ADMIN', '1'); + define('XOOPS_GROUP_USERS', '2'); + define('XOOPS_GROUP_ANONYMOUS', '3'); + + if (!isset($xoopsOption["nocommon"]) && XOOPS_ROOT_PATH != "") { + include XOOPS_ROOT_PATH."/include/common.php"; + } + } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/bootstrap/css/xoops.bootstrap.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/media/bootstrap/css/xoops.bootstrap.css 2012-10-28 14:29:31 UTC (rev 10241) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/media/bootstrap/css/xoops.bootstrap.css 2012-10-29 18:30:48 UTC (rev 10242) @@ -2,7 +2,6 @@ * Adapt Bootstrap to Xoops * $Id$ */ -@import url(bootstrap.min.css); /* Forms style */ input:required, textarea:required{ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_siteclosed.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_siteclosed.html 2012-10-28 14:29:31 UTC (rev 10241) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_siteclosed.html 2012-10-29 18:30:48 UTC (rev 10242) @@ -18,7 +18,8 @@ <!-- 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/xoops.bootstrap.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}>" /> <!--[if lte IE 8]> <link rel="stylesheet" href="<{xoImgUrl styleIE8.css}>" type="text/css" /> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2012-10-28 14:29:31 UTC (rev 10241) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2012-10-29 18:30:48 UTC (rev 10242) @@ -39,9 +39,7 @@ $xoops->theme->addStylesheet('media/xoops/css/moduladmin.css'); $xoops->theme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/style.css'); - $xoops->theme->addStylesheet($xoops->url('/media/bootstrap/css/xoops.bootstrap.css')); - $xoops->theme->addScript($xoops->url('/media/jquery/jquery.js')); $xoops->theme->addScript($xoops->url('/media/jquery/ui/jquery.ui.js')); $xoops->theme->addScript($xoops->url('/media/bootstrap/js/bootstrap.min.js')); Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media/bootstrap ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media/bootstrap/css ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media/bootstrap/css/xoops.bootstrap.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media/bootstrap/css/xoops.bootstrap.css (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/media/bootstrap/css/xoops.bootstrap.css 2012-10-29 18:30:48 UTC (rev 10242) @@ -0,0 +1,94 @@ +/** + * Adapt Bootstrap to Xoops + * $Id$ + */ +@import url(bootstrap.min.css); + +/* Forms style */ +input:required, textarea:required{ + background:url(../img/required.png) right center no-repeat; +} +input:focus:invalid, textarea:focus:invalid{ + background-image:none; +} + +.dsc_pattern_vertical{display:none;} + +input:focus:invalid + span + .dsc_pattern_vertical{ + display:block; + color: #b94a48; +} +.dsc_pattern_horizontal{display:none;} +input:focus:invalid + .dsc_pattern_horizontal{ + display:inline; + color: #b94a48; +} +.caption-required{color: #b94a48;} + +/* Area style */ +.xo-window { + background-color: #222222; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222)); + background-image: -moz-linear-gradient(top, #333333, #222222); + background-image: -ms-linear-gradient(top, #333333, #222222); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222)); + background-image: -webkit-linear-gradient(top, #333333, #222222); + background-image: -o-linear-gradient(top, #333333, #222222); + background-image: linear-gradient(top, #333333, #222222); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + -moz-border-radius: 5px 5px 0 0; + -khtml-border-top-left-radius: 5px; + -khtml-border-top-right-radius: 5px; + -webkit-border-radius-topleft: 5px; + -webkit-border-radius-topright: 5px; + border-radius: 5px 5px 0 0; + border: 1px solid #2D4760; + padding: 4px 6px 6px 4px; + height: 20px; +} +.xo-window-title { + padding: 2px 6px 6px 6px; + color: #fff; + font-weight: bold; + text-shadow: 0 0 2px #000; + font-family: tahoma, verdana, arial, sans-serif; +} +.xo-window-data { + float: left; + min-height: 50px; + padding: 6px; + width: 100%; +} + +.clear { + clear: both; +} +.spacer .spacer-mini { + padding:0 0 3px 0; +} +.spacer-mid { + padding:0 0 6px 0; +} +.spacer-large { + padding:0 0 12px 0; +} + +.txt-center { text-align: center; } + +.form-horizontal .control-label { + float: left; + width: 250px; + padding-top: 5px; + text-align: right; +} + +.form-horizontal .controls { + *display: inline-block; + *padding-left: 20px; + margin-left: 270px; + *margin-left: 0; +} Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/xotpl/head.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/xotpl/head.html 2012-10-28 14:29:31 UTC (rev 10241) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/xotpl/head.html 2012-10-29 18:30:48 UTC (rev 10242) @@ -20,6 +20,9 @@ <!-- 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}>" /> + <!-- 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> Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media/bootstrap ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media/bootstrap/css ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media/bootstrap/css/xoops.bootstrap.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media/bootstrap/css/xoops.bootstrap.css (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/media/bootstrap/css/xoops.bootstrap.css 2012-10-29 18:30:48 UTC (rev 10242) @@ -0,0 +1,94 @@ +/** + * Adapt Bootstrap to Xoops + * $Id$ + */ +@import url(bootstrap.min.css); + +/* Forms style */ +input:required, textarea:required{ + background:url(../img/required.png) right center no-repeat; +} +input:focus:invalid, textarea:focus:invalid{ + background-image:none; +} + +.dsc_pattern_vertical{display:none;} + +input:focus:invalid + span + .dsc_pattern_vertical{ + display:block; + color: #b94a48; +} +.dsc_pattern_horizontal{display:none;} +input:focus:invalid + .dsc_pattern_horizontal{ + display:inline; + color: #b94a48; +} +.caption-required{color: #b94a48;} + +/* Area style */ +.xo-window { + background-color: #222222; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222)); + background-image: -moz-linear-gradient(top, #333333, #222222); + background-image: -ms-linear-gradient(top, #333333, #222222); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222)); + background-image: -webkit-linear-gradient(top, #333333, #222222); + background-image: -o-linear-gradient(top, #333333, #222222); + background-image: linear-gradient(top, #333333, #222222); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + -moz-border-radius: 5px 5px 0 0; + -khtml-border-top-left-radius: 5px; + -khtml-border-top-right-radius: 5px; + -webkit-border-radius-topleft: 5px; + -webkit-border-radius-topright: 5px; + border-radius: 5px 5px 0 0; + border: 1px solid #2D4760; + padding: 4px 6px 6px 4px; + height: 20px; +} +.xo-window-title { + padding: 2px 6px 6px 6px; + color: #fff; + font-weight: bold; + text-shadow: 0 0 2px #000; + font-family: tahoma, verdana, arial, sans-serif; +} +.xo-window-data { + float: left; + min-height: 50px; + padding: 6px; + width: 100%; +} + +.clear { + clear: both; +} +.spacer .spacer-mini { + padding:0 0 3px 0; +} +.spacer-mid { + padding:0 0 6px 0; +} +.spacer-large { + padding:0 0 12px 0; +} + +.txt-center { text-align: center; } + +.form-horizontal .control-label { + float: left; + width: 250px; + padding-top: 5px; + text-align: right; +} + +.form-horizontal .controls { + *display: inline-block; + *padding-left: 20px; + margin-left: 270px; + *margin-left: 0; +} Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_head.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_head.html 2012-10-28 14:29:31 UTC (rev 10241) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_head.html 2012-10-29 18:30:48 UTC (rev 10242) @@ -18,7 +18,8 @@ <!-- 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/xoops.bootstrap.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="<{xoAppUrl media/bootstrap/css/bootstrap-responsive.min.css}>" />--> <!-- Theme style sheet --> <link rel="stylesheet" type="text/css" media="screen" href="<{xoImgUrl css/style.css}>" /> |
From: <du...@us...> - 2012-11-07 00:33:46
|
Revision: 10245 http://sourceforge.net/p/xoops/svn/10245 Author: dugris Date: 2012-11-07 00:33:42 +0000 (Wed, 07 Nov 2012) Log Message: ----------- fix : preload for xlanguage and common modules Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.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/preloads/core.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/xoops_version.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/templates/blocks/index.html Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2012-11-06 07:25:31 UTC (rev 10244) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2012-11-07 00:33:42 UTC (rev 10245) @@ -411,8 +411,8 @@ $this->preload->triggerEvent('core.header.addmeta'); - // load xlanguage block - $this->preload->triggerEvent('core.language.block'); + // common preload : xlanguage block, ... + $this->preload->triggerEvent('core.header.common'); // Temporary solution for start page redirection if (defined("XOOPS_STARTPAGE_REDIRECTED")) { 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-11-06 07:25:31 UTC (rev 10244) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/xlanguage.php 2012-11-07 00:33:42 UTC (rev 10245) @@ -210,7 +210,7 @@ global $xoops; $xoops->tpl->assign('theme', $xoops->getModuleConfig('theme', 'xlanguage') ); $xoops->tpl->assign('languages', $this->getAllLanguage(false) ); - return $xoops->tpl->fetch('db:xlanguage_admin_list.html'); + return $xoops->tpl->fetch('admin:xlanguage|xlanguage_admin_list.html'); } } ?> \ 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-11-06 07:25:31 UTC (rev 10244) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php 2012-11-07 00:33:42 UTC (rev 10245) @@ -36,7 +36,7 @@ } } - static public function eventCoreLanguageBlock($args) + static public function eventCoreHeaderCommon($args) { include_once dirname(dirname(__FILE__)) . '/include/vars.php'; include_once dirname(dirname(__FILE__)) . '/include/functions.php'; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/templates/blocks/index.html =================================================================== Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/xoops_version.php 2012-11-06 07:25:31 UTC (rev 10244) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/xoops_version.php 2012-11-07 00:33:42 UTC (rev 10245) @@ -98,12 +98,6 @@ $modversion['templates'][$cpt]['file'] = 'blocks/xlanguage_block_bootstrap.html'; $modversion['templates'][$cpt]['description'] = ''; -// Admin templates -$cpt++; -$modversion['templates'][$cpt]['file'] = 'xlanguage_admin_list.html'; -$modversion['templates'][$cpt]['description'] = ''; -$modversion['templates'][$cpt]['type'] = 'admin'; - // Config XoopsLoad::load('xoopslists'); |
From: <du...@us...> - 2012-11-09 13:19:36
|
Revision: 10251 http://sourceforge.net/p/xoops/svn/10251 Author: dugris Date: 2012-11-09 13:19:32 +0000 (Fri, 09 Nov 2012) Log Message: ----------- fix : module renderindex Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/css/module.css 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-11-08 08:17:07 UTC (rev 10250) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-11-09 13:19:32 UTC (rev 10251) @@ -258,16 +258,17 @@ $xoops = Xoops::getInstance(); $this->_obj->loadAdminMenu(); foreach (array_keys($this->_obj->adminmenu) as $i) { -// if ($this->_obj->adminmenu[$i]['link'] != 'admin/index.php') { - //$this->_obj->adminmenu[$i]['icon'] = XOOPS_URL . "/modules/" . $this->_obj->getVar('dirname') . "/" . $this->_obj->adminmenu[$i]['icon']; - $this->_obj->adminmenu[$i]['icon'] = XOOPS_URL . "/media/xoops/images/icons/32/" . $this->_obj->adminmenu[$i]['icon']; - $xoops->tpl->append('xo_admin_index_menu', $this->_obj->adminmenu[$i]); -// } + 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->append('xo_admin_index_menu', $this->_obj->adminmenu[$i]); } if ($this->_obj->getInfo('help')) { $help = array(); $help['link'] = '../system/help.php?mid=' . $this->_obj->getVar('mid', 's') . "&" . $this->_obj->getInfo('help'); - $help['icon'] = XOOPS_URL . "/media/xoops/images/icons/32/help.png"; + $help['icon'] = $xoops->url("/media/xoops/images/icons/32/help.png"); $help['title'] = _AM_SYSTEM_HELP; $xoops->tpl->append('xo_admin_index_menu', $help); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/css/module.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/css/module.css 2012-11-08 08:17:07 UTC (rev 10250) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/css/module.css 2012-11-09 13:19:32 UTC (rev 10251) @@ -147,7 +147,7 @@ font-family: arial,helvetica,sans-serif; margin: 3px 3px 5px; overflow: hidden; - width: 250px; + width: 244px; } .xo-module-list .system { background: none repeat scroll 0 0 #faeaea; |
From: <du...@us...> - 2012-11-23 22:33:15
|
Revision: 10268 http://sourceforge.net/p/xoops/svn/10268 Author: dugris Date: 2012-11-23 22:33:12 +0000 (Fri, 23 Nov 2012) Log Message: ----------- Add template for search result Fix admin theme Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/mainfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops.css Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html Property Changed: ---------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/mainfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/mainfile.php 2012-11-22 19:38:36 UTC (rev 10267) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/mainfile.php 2012-11-23 22:33:12 UTC (rev 10268) @@ -17,6 +17,65 @@ * @version $Id$ */ -if (! defined('XOOPS_INSTALL')) { - header('Location: install/index.php'); +if (!defined("XOOPS_MAINFILE_INCLUDED")) { + define("XOOPS_MAINFILE_INCLUDED", 1); + + // XOOPS Physical Paths + + // Physical path to the XOOPS documents (served) directory WITHOUT trailing slash + define('XOOPS_ROOT_PATH', 'C:/Internet/Xoops/Xoops_2.6.0/htdocs'); + + // For forward compatibility + // Physical path to the XOOPS library directory WITHOUT trailing slash + define('XOOPS_PATH', 'C:/Internet/Xoops/Xoops_2.6.0/htdocs/xoops_lib'); + // Physical path to the XOOPS datafiles (writable) directory WITHOUT trailing slash + define('XOOPS_VAR_PATH', 'C:/Internet/Xoops/Xoops_2.6.0/htdocs/xoops_data'); + // Alias of XOOPS_PATH, for compatibility, temporary solution + define("XOOPS_TRUST_PATH", XOOPS_PATH); + + // URL Association for SSL and Protocol Compatibility + $http = 'http://'; + if (!empty($_SERVER['HTTPS'])) { + $http = ($_SERVER['HTTPS']=='on') ? 'https://' : 'http://'; + } + define('XOOPS_PROT', $http); + + // XOOPS Virtual Path (URL) + // Virtual path to your main XOOPS directory WITHOUT trailing slash + // Example: define('XOOPS_URL', 'http://dugris.no-ip.org/Xoops/Xoops_2.6.0/htdocs'); + define('XOOPS_URL', 'http://dugris.no-ip.org:8090'); + + // Shall be handled later, don't forget! + define("XOOPS_CHECK_PATH", 0); + // Protect against external scripts execution if safe mode is not enabled + if (XOOPS_CHECK_PATH && !@ini_get("safe_mode")) { + if (function_exists("debug_backtrace")) { + $xoopsScriptPath = debug_backtrace(); + if (!count($xoopsScriptPath)) { + die("XOOPS path check: this file cannot be requested directly"); + } + $xoopsScriptPath = $xoopsScriptPath[0]["file"]; + } else { + $xoopsScriptPath = isset($_SERVER["PATH_TRANSLATED"]) ? $_SERVER["PATH_TRANSLATED"] : $_SERVER["SCRIPT_FILENAME"]; + } + if (DIRECTORY_SEPARATOR != "/") { + // IIS6 may double the \ chars + $xoopsScriptPath = str_replace(strpos($xoopsScriptPath, "\\\\", 2) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $xoopsScriptPath); + } + if (strcasecmp(substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace(DIRECTORY_SEPARATOR, "/", XOOPS_ROOT_PATH))) { + exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run."); + } + } + + // Secure file + require XOOPS_VAR_PATH . '/data/secure.php'; + + define('XOOPS_GROUP_ADMIN', '1'); + define('XOOPS_GROUP_USERS', '2'); + define('XOOPS_GROUP_ANONYMOUS', '3'); + + if (!isset($xoopsOption["nocommon"]) && XOOPS_ROOT_PATH != "") { + include XOOPS_ROOT_PATH."/include/common.php"; + } + } \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html 2012-11-23 22:33:12 UTC (rev 10268) @@ -0,0 +1,82 @@ +<fieldset> + <{if $search}> + <legend><{$smarty.const._SR_SEARCHRESULTS}></legend> + <div> + <{$smarty.const._SR_KEYWORDS}> : + <span class="bold"> + <{foreachq from=$queries item=query name=foo}> + <{$query}><{if !$smarty.foreach.foo.last}>,<{/if}> + <{/foreach}> + </span> + <{if $sr_showing}> + <br /> + <{$sr_showing}> + <{/if}> + </div> + <{if count($ignored_queries) != 0}> + <div> + <{$ignored_words}> : + <span class="bold"> + <{foreachq from=$ignored_queries item=query name=foo}> + <{$query}><{if !$smarty.foreach.foo.last}>,<{/if}> + <{/foreach}> + </span> + </div> + <{/if}> + <{/if}> + + <{if count($modules) > 0}> + <{foreachq from=$modules item=module name=foo}> + <div class="searchModule"> + <div class="searchIcon floatleft"> + <img src="<{$module.image}>" alt="<{$module.name}>"> + </div> + <div class="searchTitle floatleft"> + <{$module.name}> + </div> + <{if $module.search_url}> + <div class="floatright"> + <a href="<{$module.search_url}>" title="<{$smarty.const._SR_SHOWALLR}>"><{$smarty.const._SR_SHOWALLR}></a> + </div> + <{/if}> + <div class="clear"></div> + + <{foreach from=$module.result item=result}> + <div class="searchItem"> + <div class="bold"><a href="<{$result.link}>" title="<{$result.title}>"><{$result.title}></a></div> + <div><{$result.content}></div> + <span class='x-small'> + <{if $result.uid}> + <a href="<{$xoops_url}>/userinfo.php?uid=<{$result.uid}>" title="<{$result.uname}>"><{$result.uname}></a> + <{/if}> + ( <{$result.time}> ) + </span> + </div> + <{/foreach}> + </div> + + <!-- prev / next --> + <{if $module.prev || $module.next}> + <div> + <{if $module.prev}> + <div class="floatleft"> + <a href="<{$module.prev}>" title="<{$smarty.const._SR_PREVIOUS}>"><{$smarty.const._SR_PREVIOUS}></a> + </div> + <{/if}> + <{if $module.next}> + <div class="floatright"> + <a href="<{$module.next}>" title="<{$smarty.const._SR_NEXT}>"><{$smarty.const._SR_NEXT}></a> + </div> + <{/if}> + </div> + <{/if}> + <{/foreach}> + <{else}> + <div class="searchModule bold"> + <{$smarty.const._SR_NOMATCH}> + </div> + <{/if}> +</fieldset> + +<!-- Display form --> +<{includeq file="module:system|system_form.html"}> Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2012-11-22 19:38:36 UTC (rev 10267) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2012-11-23 22:33:12 UTC (rev 10268) @@ -88,8 +88,11 @@ foreach (array_keys($mod_options) as $item) { $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link']; - $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' - : XOOPS_URL . "/media/xoops/images/icons/32/" . $mod_options[$item]['icon']; + if ( file_exists($xoops->path("/media/xoops/images/icons/32/" . $mod_options[$item]['icon']) ) ) { + $mod_options[$item]['icon'] = $xoops->url("/media/xoops/images/ico |
From: <du...@us...> - 2012-11-24 00:09:18
|
Revision: 10270 http://sourceforge.net/p/xoops/svn/10270 Author: dugris Date: 2012-11-24 00:09:14 +0000 (Sat, 24 Nov 2012) Log Message: ----------- Add hightlight for search result Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops.css Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html 2012-11-23 22:37:04 UTC (rev 10269) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html 2012-11-24 00:09:14 UTC (rev 10270) @@ -43,7 +43,7 @@ <{foreach from=$module.result item=result}> <div class="searchItem"> - <div class="bold"><a href="<{$result.link}>" title="<{$result.title}>"><{$result.title}></a></div> + <div class="bold"><a href="<{$result.link}>" title="<{$result.title}>"><{$result.title_highligh}></a></div> <div><{$result.content}></div> <span class='x-small'> <{if $result.uid}> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2012-11-23 22:37:04 UTC (rev 10269) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2012-11-24 00:09:14 UTC (rev 10270) @@ -123,6 +123,7 @@ $q = trim($q); if (strlen($q) >= $xoopsConfigSearch['keyword_min']) { $queries[] = $myts->addSlashes($q); + $queries_pattern[] = '~(' . $q . ')~sUi'; } else { $ignored_queries[] = $myts->addSlashes($q); } @@ -136,6 +137,7 @@ $xoops->redirect('search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); } $queries = array($myts->addSlashes($query)); + $queries_pattern[] = '~(' . $myts->addSlashes($query) . ')~sUi'; } } switch ($action) { @@ -184,10 +186,11 @@ $res[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; } $res[$i]['title'] = $myts->htmlspecialchars($results[$i]['title']); + $res[$i]['title_highligh'] = preg_replace( $queries_pattern, "<span class='searchHighlight'>$1</span>", $myts->htmlspecialchars($results[$i]['title'])); $res[$i]['uid'] = @intval($results[$i]['uid']); $res[$i]['uname'] = XoopsUser::getUnameFromId($results[$i]['uid']); $res[$i]['time'] = !empty($results[$i]['time']) ? " (" . XoopsLocal::formatTimestamp(intval($results[$i]['time'])) . ")" : ""; - $res[$i]['content'] = !empty($results[$i]['content']) ? $results[$i]['content'] : ""; + $res[$i]['content'] = empty($results[$i]['content']) ? "" : preg_replace( $queries_pattern, "<span class='searchHighlight'>$1</span>", $results[$i]['content']); } if ($count >= 5) { $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); @@ -245,10 +248,11 @@ $res[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; } $res[$i]['title'] = $myts->htmlspecialchars($results[$i]['title']); + $res[$i]['title_highligh'] = preg_replace( $queries_pattern, "<span class='searchHighlight'>$1</span>", $myts->htmlspecialchars($results[$i]['title'])); $res[$i]['uid'] = @intval($results[$i]['uid']); $res[$i]['uname'] = XoopsUser::getUnameFromId($results[$i]['uid']); $res[$i]['time'] = !empty($results[$i]['time']) ? " (" . XoopsLocal::formatTimestamp(intval($results[$i]['time'])) . ")" : ""; - $res[$i]['content'] = !empty($results[$i]['content']) ? $results[$i]['content'] : ""; + $res[$i]['content'] = empty($results[$i]['content']) ? "" : preg_replace( $queries_pattern, "<span class='searchHighlight'>$1</span>", $results[$i]['content']); } if ( count($res) > 0 ) { $modules_result[$mid]['result'] = $res; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops.css 2012-11-23 22:37:04 UTC (rev 10269) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops.css 2012-11-24 00:09:14 UTC (rev 10270) @@ -439,4 +439,7 @@ margin: 10px 0; padding: 5px; border: 1px solid #eee; -} \ No newline at end of file +} +.searchHighlight { + background-color: #ffed00; +} |
From: <tr...@us...> - 2012-11-25 01:21:44
|
Revision: 10271 http://sourceforge.net/p/xoops/svn/10271 Author: trabis Date: 2012-11-25 01:21:41 +0000 (Sun, 25 Nov 2012) Log Message: ----------- Fixing some notification related bugs Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_notification_select.html Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php 2012-11-24 00:09:14 UTC (rev 10270) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php 2012-11-25 01:21:41 UTC (rev 10271) @@ -139,7 +139,7 @@ { $xoops = Xoops::getInstance(); if (!isset($module_id)) { - $module_id = !$xoops->isModule() ? $xoops->module->getVar('mid') : 0; + $module_id = $xoops->isModule() ? $xoops->module->getVar('mid') : 0; $module = $xoops->module; } else { $module = $xoops->getHandlerModule()->getById($module_id); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_notification_select.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_notification_select.html 2012-11-24 00:09:14 UTC (rev 10270) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_notification_select.html 2012-11-25 01:21:41 UTC (rev 10271) @@ -2,7 +2,7 @@ <form name="notification_select" action="<{$xoops_notification.target_page}>" method="post"> <h4 class="txtcenter"><{$lang_activenotifications}></h4> <input type="hidden" name="not_redirect" value="<{$xoops_notification.redirect_script}>" /> - <input type="hidden" name="XOOPS_TOKEN_REQUEST" value="<{php}>echo $xoops->security->createToken();<{/php}>" /> + <input type="hidden" name="XOOPS_TOKEN_REQUEST" value="<{php}>echo Xoops::getInstance()->security->createToken();<{/php}>" /> <table class="outer"> <tr><th colspan="3"><{$lang_notificationoptions}></th></tr> <tr> |
From: <ma...@us...> - 2012-11-30 20:27:39
|
Revision: 10291 http://sourceforge.net/p/xoops/svn/10291 Author: mageg Date: 2012-11-30 20:27:36 +0000 (Fri, 30 Nov 2012) Log Message: ----------- add extension or module config in moduleadmin Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/admin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_index.html 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-11-30 19:51:57 UTC (rev 10290) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-11-30 20:27:36 UTC (rev 10291) @@ -129,6 +129,38 @@ } } break; + + case "extension": + $xoops = Xoops::getInstance(); + if (is_array($value)) { + $text = $value[0]; + $type = $value[1]; + } else { + $text = $value; + $type = 'error'; + } + if ($xoops->isActiveModule($value) == 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)); + } + break; + + case "module": + $xoops = Xoops::getInstance(); + if (is_array($value)) { + $text = $value[0]; + $type = $value[1]; + } else { + $text = $value; + $type = 'error'; + } + if ($xoops->isActiveModule($value) == 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)); + } + break; } return true; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/admin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/admin.php 2012-11-30 19:51:57 UTC (rev 10290) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/admin.php 2012-11-30 20:27:36 UTC (rev 10291) @@ -29,6 +29,10 @@ define('_AM_MODULEADMIN_CONFIG_PHP','Minimum PHP required: %s (your version is %s)'); define('_AM_MODULEADMIN_CONFIG_XOOPS','Minimum XOOPS required: %s (your version is %s)'); define('_AM_MODULEADMIN_CONFIG_DB','minimum version required: %s (your version is %s)'); +define('_AM_MODULEADMIN_CONFIG_EXTENSIONKO',"The extension '%s' isn't installed"); +define('_AM_MODULEADMIN_CONFIG_EXTENSIONOK',"The extension '%s' is installed"); +define('_AM_MODULEADMIN_CONFIG_MODULEKO',"The module '%s' isn't installed"); +define('_AM_MODULEADMIN_CONFIG_MODULEOK',"The module '%s' is installed"); // About define('_AM_MODULEADMIN_ABOUT_CHANGELOG','Change log'); define('_AM_MODULEADMIN_ABOUT_DESCRIPTION','Description:'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_index.html 2012-11-30 19:51:57 UTC (rev 10290) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_index.html 2012-11-30 20:27:36 UTC (rev 10291) @@ -28,6 +28,10 @@ <li class="red"> <span class="ico ico-cross"></span> <{$config.text}> </li> + <{elseif $config.type == 'warning'}> + <li class="orange"> + <span class="ico ico-warning"></span> <{$config.text}> + </li> <{else}> <li class="green"> <span class="ico ico-tick"></span> <{$config.text}> |
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 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 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-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 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: <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: <du...@us...> - 2012-12-06 04:04:19
|
Revision: 10326 http://sourceforge.net/p/xoops/svn/10326 Author: dugris Date: 2012-12-06 04:04:15 +0000 (Thu, 06 Dec 2012) Log Message: ----------- replace $form->render() with $form->display() Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php 2012-12-06 02:19:25 UTC (rev 10325) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php 2012-12-06 04:04:15 UTC (rev 10326) @@ -236,7 +236,7 @@ if ($xoopsConfigUser['allow_chgmail'] == 1) { $form->setRequired($email_text); } - $form->render(false); + $form->display(); $xoops->footer(); } @@ -260,7 +260,7 @@ $form->addElement(new XoopsFormHidden('op', 'avatarupload')); $form->addElement(new XoopsFormHidden('uid', $xoops->user->getVar('uid'))); $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - $form->render(false); + $form->display(); } $avatar_handler = $xoops->getHandlerAvatar(); $form2 = new XoopsThemeForm(_US_CHOOSEAVT, 'uploadavatar', 'edituser.php', 'post', true); @@ -278,7 +278,7 @@ $form2->addElement(new XoopsFormHidden('uid', $xoops->user->getVar('uid'))); $form2->addElement(new XoopsFormHidden('op', 'avatarchoose')); $form2->addElement(new XoopsFormButton('', 'submit2', _SUBMIT, 'submit')); - $form2->render(false); + $form2->display(); $xoops->footer(); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html 2012-12-06 02:19:25 UTC (rev 10325) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html 2012-12-06 04:04:15 UTC (rev 10326) @@ -76,7 +76,4 @@ <{$smarty.const._SR_NOMATCH}> </div> <{/if}> -</fieldset> - -<!-- Display form --> -<{includeq file="module:system|system_form.html"}> +</fieldset> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2012-12-06 02:19:25 UTC (rev 10325) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2012-12-06 04:04:15 UTC (rev 10326) @@ -82,7 +82,7 @@ } else { echo "<span class='red'>$stop</span>"; include $xoops->path('include/registerform.php'); - $reg_form->render(false); + $reg_form->display(); } $xoops->footer(); break; @@ -188,7 +188,7 @@ } else { echo "<span class='red bold'>{$stop}</span>"; include $xoops->path('include/registerform.php'); - $reg_form->render(false); + $reg_form->display(); } $xoops->footer(); break; @@ -250,7 +250,7 @@ $xoops->theme->addMeta('meta', 'keywords', _US_USERREG . ", " . _US_NICKNAME); // FIXME! $xoops->theme->addMeta('meta', 'description', strip_tags($xoopsConfigUser['reg_disclaimer'])); include $xoops->path('include/registerform.php'); - $reg_form->render(false); + $reg_form->display(); $xoops->footer(); break; } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2012-12-06 02:19:25 UTC (rev 10325) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2012-12-06 04:04:15 UTC (rev 10326) @@ -106,7 +106,7 @@ if ($action == 'search') { $xoops->header(); include $xoops->path('include/searchform.php'); - $search_form->render(false); + $search_form->display(); $xoops->footer(); exit; } @@ -139,6 +139,7 @@ $queries_pattern[] = '~(' . $myts->addSlashes($query) . ')~sUi'; } } + switch ($action) { case "results": $module_handler = $xoops->getHandlerModule(); @@ -206,7 +207,7 @@ } $xoops->tpl->assign('modules', $modules_result); include $xoops->path('include/searchform.php'); - $search_form->render(); + $search_form->display(); break; case "showall": |
From: <du...@us...> - 2012-12-06 14:57:09
|
Revision: 10327 http://sourceforge.net/p/xoops/svn/10327 Author: dugris Date: 2012-12-06 14:57:05 +0000 (Thu, 06 Dec 2012) Log Message: ----------- fix : insert, updata tplfile, tplsource remove quoteString (insert/update) Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php 2012-12-06 04:04:15 UTC (rev 10326) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php 2012-12-06 14:57:05 UTC (rev 10327) @@ -255,7 +255,7 @@ } if ($tplfile->isNew()) { $tpl_id = $this->db->genId('tpltpl_file_id_seq'); - $sql = sprintf("INSERT INTO %s (tpl_id, tpl_module, tpl_refid, tpl_tplset, tpl_file, tpl_desc, tpl_lastmodified, tpl_lastimported, tpl_type) VALUES (%u, %s, %u, %s, %s, %s, %u, %u, %s)", $this->db->prefix('tplfile'), $tpl_id, $this->db->quoteString($tpl_module), $tpl_refid, $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastmodified, $tpl_lastimported, $this->db->quoteString($tpl_type)); + $sql = sprintf("INSERT INTO %s (tpl_id, tpl_module, tpl_refid, tpl_tplset, tpl_file, tpl_desc, tpl_lastmodified, tpl_lastimported, tpl_type) VALUES (%u, %s, %u, %s, %s, %s, %u, %u, %s)", $this->db->prefix('tplfile'), $tpl_id, $tpl_module, $tpl_refid, $tpl_tplset, $tpl_file, $tpl_desc, $tpl_lastmodified, $tpl_lastimported, $tpl_type); if (!$this->db->query($sql)) { return false; } @@ -263,7 +263,7 @@ $tpl_id = $this->db->getInsertId(); } if (isset($tpl_source) && $tpl_source != '') { - $sql = sprintf("INSERT INTO %s (tpl_id, tpl_source) VALUES (%u, %s)", $this->db->prefix('tplsource'), $tpl_id, $this->db->quoteString($tpl_source)); + $sql = sprintf("INSERT INTO %s (tpl_id, tpl_source) VALUES (%u, %s)", $this->db->prefix('tplsource'), $tpl_id, $tpl_source); if (!$this->db->query($sql)) { $this->db->query(sprintf("DELETE FROM %s WHERE tpl_id = %u", $this->db->prefix('tplfile'), $tpl_id)); return false; @@ -271,12 +271,12 @@ } $tplfile->assignVar('tpl_id', $tpl_id); } else { - $sql = sprintf("UPDATE %s SET tpl_tplset = %s, tpl_file = %s, tpl_desc = %s, tpl_lastimported = %u, tpl_lastmodified = %u WHERE tpl_id = %u", $this->db->prefix('tplfile'), $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastimported, $tpl_lastmodified, $tpl_id); + $sql = sprintf("UPDATE %s SET tpl_tplset = %s, tpl_file = %s, tpl_desc = %s, tpl_lastimported = %u, tpl_lastmodified = %u WHERE tpl_id = %u", $this->db->prefix('tplfile'), $tpl_tplset, $tpl_file, $tpl_desc, $tpl_lastimported, $tpl_lastmodified, $tpl_id); if (!$this->db->query($sql)) { return false; } if (isset($tpl_source) && $tpl_source != '') { - $sql = sprintf("UPDATE %s SET tpl_source = %s WHERE tpl_id = %u", $this->db->prefix('tplsource'), $this->db->quoteString($tpl_source), $tpl_id); + $sql = sprintf("UPDATE %s SET tpl_source = %s WHERE tpl_id = %u", $this->db->prefix('tplsource'), $tpl_source, $tpl_id); if (!$this->db->query($sql)) { return false; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php 2012-12-06 04:04:15 UTC (rev 10326) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php 2012-12-06 14:57:05 UTC (rev 10327) @@ -831,6 +831,7 @@ $tplfile_new->setVar('tpl_type', 'block'); } else { $tplfile_new = $tplfile[0]; + $tplfile_new->setVars($tplfile_new->toArray()); } $tplfile_new->setVar('tpl_source', $content, true); $tplfile_new->setVar('tpl_desc', $block['description'], true); |
From: <tr...@us...> - 2012-12-08 01:46:08
|
Revision: 10329 http://sourceforge.net/p/xoops/svn/10329 Author: trabis Date: 2012-12-08 01:46:05 +0000 (Sat, 08 Dec 2012) Log Message: ----------- Fixing php 5.4.3 warnings Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.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/class/form/preference.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/theme_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2012-12-07 00:56:07 UTC (rev 10328) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2012-12-08 01:46:05 UTC (rev 10329) @@ -152,6 +152,7 @@ */ public function buildBlock($xobject, &$template) { + $xoops = Xoops::getInstance(); // The lame type workaround will change // bid is added temporarily as workaround for specific block manipulation $dirname = $xobject->getVar('dirname'); @@ -172,7 +173,7 @@ : "module:system|system_block_dummy.html"; $cacheid = $this->generateCacheId('blk_' . $xobject->getVar('bid')); - Xoops::getInstance()->preload()->triggerEvent('core.themeblocks.buildblock.start', array($xobject, $template->is_cached($tplName, $cacheid))); + $xoops->preload()->triggerEvent('core.themeblocks.buildblock.start', array($xobject, $template->is_cached($tplName, $cacheid))); if (!$bcachetime || !$template->is_cached($tplName, $cacheid)) { @@ -196,7 +197,7 @@ if ($this->theme && $bcachetime) { $metas = array(); foreach ($this->theme->metas as $type => $value) { - $dif = array_diff_assoc($this->theme->metas[$type], $old[$type]); + $dif = $xoops->arrayRecursiveDiff($this->theme->metas[$type], $old[$type]); if (count($dif)) { $metas[$type] = $dif; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php 2012-12-07 00:56:07 UTC (rev 10328) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php 2012-12-08 01:46:05 UTC (rev 10329) @@ -41,7 +41,7 @@ function createConfigform($config) { $xoops = Xoops::getInstance(); - //$config_handler = $xoops->getHandlerConfig(); + $config_handler = $xoops->getHandlerConfig(); //$xoops->config = $config_handler->getConfigsByCat(XOOPS_CONF); //$config =& $xoops->config; @@ -111,8 +111,6 @@ asort($dirlist); $ele->addOptionArray($dirlist); } - // old theme value is used to determine whether to update cache or not. kind of dirty way - $ele = new XoopsFormHidden('_old_theme', $config[$i]->getConfValueForOutput()); break; case 'tplset': @@ -123,8 +121,6 @@ foreach ($tplsetlist as $key => $name) { $ele->addOption($key, $name); } - // old theme value is used to determine whether to update cache or not. kind of dirty way - $ele = new XoopsFormHidden('_old_theme', $config[$i]->getConfValueForOutput()); break; case 'timezone': 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-07 00:56:07 UTC (rev 10328) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2012-12-08 01:46:05 UTC (rev 10329) @@ -556,20 +556,24 @@ /** * insert/update object * - * @param object $object + * @param XoopsObject $object + * @param bool $force + * * @abstract */ - public function insert($object) + function insert(XoopsObject $object, $force = true) { } /** * delete object from database * - * @param object $object + * @param XoopsObject $object + * @param bool $force + * * @abstract */ - public function delete($object) + public function delete(XoopsObject $object, $force = true) { } } Modified: XoopsCore/bra |
From: <tr...@us...> - 2012-12-08 19:11:40
|
Revision: 10330 http://sourceforge.net/p/xoops/svn/10330 Author: trabis Date: 2012-12-08 19:11:36 +0000 (Sat, 08 Dec 2012) Log Message: ----------- Finishing adding the necessary preloads for logger events. Adding method to disable php error reporting with an event attached Preparing protector to use an eventual logger module to dump queries Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php XoopsCore/branches/2.6.x/2.6.0/htdocs/comments.php XoopsCore/branches/2.6.x/2.6.0/htdocs/footer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/cp_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/formdhtmltextarea_preview.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.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/system/admin/modulesadmin/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/jquery.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/jquery.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/preloads/core.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/Xoops.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -21,7 +21,7 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->logger()->disable(); +$xoops->disableErrorReporting(); if (function_exists('mb_http_output')) { mb_http_output('pass'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/comments.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/comments.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/comments.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -33,7 +33,7 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->logger()->disable(); +$xoops->disableErrorReporting(); if (function_exists('mb_http_output')) { mb_http_output('pass'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/footer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/footer.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/footer.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -23,5 +23,5 @@ $xoops = Xoops::getInstance(); $xoops->preload()->triggerEvent('core.include.footer'); -$xoops->logger()->addDeprecated("include 'footer.php' is deprecated since 2.6.0, use Xoops::getInstance()->footer(); instead"); +$xoops->deprecated("include 'footer.php' is deprecated since 2.6.0, use Xoops::getInstance()->footer(); instead"); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/header.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/header.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/header.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -25,5 +25,5 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); $xoops = Xoops::getInstance(); -$xoops->logger()->addDeprecated("include 'header.php' is deprecated since 2.6.0, use Xoops::getInstance()->header(); instead"); +$xoops->deprecated("include 'header.php' is deprecated since 2.6.0, use Xoops::getInstance()->header(); instead"); $xoops->header($xoops->getOption('template_main')); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/image.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/image.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -19,7 +19,6 @@ * @version $Id$ */ -error_reporting(0); if (version_compare(PHP_VERSION, '5.3.0', '<')) { set_magic_quotes_runtime(0); } @@ -40,7 +39,7 @@ include_once XOOPS_ROOT_PATH . '/class/xoopsload.php'; $xoops = Xoops::getInstance(); -$xoops->logger()->startTime(); +$xoops->disableErrorReporting(); define('XOOPS_DB_PROXY', 1); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -110,6 +110,8 @@ trigger_error('File Path Error: ' . 'var/configs/xoopsconfig.php' . ' does not exist.'); } +$xoopsPreload->triggerEvent('core.include.common.configs.success'); + /** * Enable Gzip compression, * Requires configs loaded and should go before any output @@ -117,17 +119,6 @@ $xoops->gzipCompression(); /** - * Start of Error Reportings. - */ -if ($xoops->getConfig('debug_mode') == 1 || $xoops->getConfig('debug_mode') == 2) { - $xoops->loadLanguage('logger'); - $xoops->logger()->enable(); - $xoops->logger()->usePopup = ($xoops->getConfig('debug_mode') == 2); -} else { - $xoops->logger()->disable(); -} - -/** * Check Bad Ip Addressed against database and block bad ones, requires configs loaded */ $xoops->security()->checkBadips(); @@ -211,20 +202,7 @@ } } -/** - * *#@+ - * Debug level for XOOPS - * Check /xoops_data/configs/xoopsconfig.php for details - * - * Note: temporary solution only. Will be re-designed in XOOPS 3.0 - */ -if ($xoops->logger()->isEnable()) { - $level = $xoops->getConfig('debugLevel') ? $xoops->getConfig('debugLevel') : 0; - if (($level == 2 && !$xoops->userIsAdmin) || ($level == 1 && !$xoops->isUser())) { - $xoops->logger()->disable(); - } - unset($level); -} +$xoopsPreload->triggerEvent('core.include.common.auth.success'); /** * Theme Selection @@ -289,6 +267,4 @@ //Creates 'system_modules_active' cache file if it has been deleted. $xoops->getActiveModules(); -$xoops->logger()->stopTime('XOOPS Boot'); -$xoops->logger()->startTime('Module init'); $xoops->preload()->triggerEvent('core.include.common.end'); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/cp_functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/cp_functions.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/cp_functions.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -25,7 +25,7 @@ function xoops_cp_header() { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated('xoops_cp_header() is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated('xoops_cp_header() is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->header($xoops->getOption('template_main')); } @@ -36,6 +36,6 @@ function xoops_cp_footer() { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated('xoops_cp_footer() is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated('xoops_cp_footer() is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->footer($xoops->getOption('template_main')); } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/formdhtmltextarea_preview.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/formdhtmltextarea_preview.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/formdhtmltextarea_preview.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -21,7 +21,7 @@ include_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->logger()->disable(); +$xoops->disableErrorReporting(); $myts = MyTextSanitizer::getInstance(); $content = $myts->stripSlashesGPC($_POST['text']); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -27,7 +27,7 @@ function xoops_getHandler($name, $optional = false) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated('xoops_getHandler(\'' . $name . '\') is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated('xoops_getHandler(\'' . $name . '\') is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $method = 'getHandler' . ucfirst(strtolower(trim($name))); return $xoops->$method($optional); } @@ -42,7 +42,7 @@ function xoops_getModuleHandler($name = null, $module_dir = null, $optional = false) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getModuleHandler($name, $module_dir, $optional); } @@ -55,7 +55,7 @@ function xoops_load($name, $type = 'core') { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return XoopsLoad::load($name, $type); } @@ -71,7 +71,7 @@ function xoops_loadLanguage($name, $domain = '', $language = null) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->loadLanguage($name, $domain, $language); } @@ -82,7 +82,7 @@ function xoops_getActiveModules() { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getActiveModules(); } @@ -93,7 +93,7 @@ function xoops_setActiveModules() { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->setActiveModules(); } @@ -105,7 +105,7 @@ function xoops_isActiveModule($dirname) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->isActiveModule($dirname); } @@ -117,7 +117,7 @@ function xoops_header($closehead = true) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->simpleHeader($closehead); } @@ -128,7 +128,7 @@ function xoops_footer() { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->simpleFooter(); } @@ -141,7 +141,7 @@ function xoops_error($msg, $title = '') { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->error($msg, $title); } @@ -154,7 +154,7 @@ function xoops_result($msg, $title = '') { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->result($msg, $title); } @@ -170,7 +170,7 @@ function xoops_confirm($hiddens, $action, $msg, $submit = '', $addtoken = true) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->confirm($hiddens, $action, $msg, $submit, $addtoken); } @@ -183,7 +183,7 @@ function xoops_getUserTimestamp($time, $timeoffset = '') { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getUserTimestamp($time, $timeoffset); } @@ -197,7 +197,7 @@ function formatTimestamp($time, $format = 'l', $timeoffset = '') { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return XoopsLocal::formatTimestamp($time, $format, $timeoffset); } @@ -210,7 +210,7 @@ function userTimeToServerTime($timestamp, $userTZ = null) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->userTimeToServerTime($timestamp, $userTZ); } @@ -221,7 +221,7 @@ function xoops_makepass() { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->makePass(); } @@ -234,7 +234,7 @@ function checkEmail($email, $antispam = false) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->checkEmail($email, $antispam); } @@ -246,7 +246,7 @@ function formatURL($url) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->formatURL($url); } @@ -257,7 +257,7 @@ function xoops_getbanner() { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getBanner(); } @@ -273,7 +273,7 @@ function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->redirect($url, $time, $message, $addredirect, $allowExternalLink); } @@ -285,7 +285,7 @@ function xoops_getenv($key) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getEnv($key); } @@ -297,7 +297,7 @@ function xoops_getcss($theme = '') { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getCss($theme); } @@ -308,7 +308,7 @@ function xoops_getMailer() { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getMailer(); } @@ -321,7 +321,7 @@ function xoops_getrank($rank_id = 0, $posts = 0) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getRank($rank_id, $posts); } @@ -336,7 +336,7 @@ function xoops_substr($str, $start, $length, $trimmarker = '...') { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return XoopsLocal::substr($str, $start, $length, $trimmarker); } @@ -348,7 +348,7 @@ function xoops_notification_deletebymodule($module_id) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getHandlerNotification()->unsubscribeByModule($module_id); } @@ -360,7 +360,7 @@ function xoops_notification_deletebyuser($user_id) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getHandlerNotification()->unsubscribeByUser($user_id); } @@ -374,7 +374,7 @@ function xoops_notification_deletebyitem($module_id, $category, $item_id) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getHandlerNotification()->unsubscribeByItem($module_id, $category, $item_id); } @@ -387,7 +387,7 @@ function xoops_comment_count($module_id, $item_id = null) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getHandlerComment()->getCountByModuleId($module_id, $item_id); } @@ -400,7 +400,7 @@ function xoops_comment_delete($module_id, $item_id) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getHandlerComment()->deleteByItemId($module_id, $item_id); } @@ -414,7 +414,7 @@ function xoops_groupperm_deletebymoditem($module_id, $perm_name, $item_id = null) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getHandlerGroupperm()->deleteByModule($module_id, $perm_name, $item_id); } @@ -426,7 +426,7 @@ function xoops_utf8_encode(&$text) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); XoopsLocal::utf8_encode($text); } @@ -438,7 +438,7 @@ function xoops_convert_encoding(&$text) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); XoopsLocal::utf8_encode($text); } @@ -450,7 +450,7 @@ function xoops_trim($text) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return XoopsLocal::trim($text); } @@ -462,7 +462,7 @@ function xoops_getOption($option) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getOption($option); } @@ -475,7 +475,7 @@ function xoops_getConfigOption($option, $type = 'XOOPS_CONF') { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getConfig($option, $type); } @@ -488,7 +488,7 @@ function xoops_setConfigOption($option, $new = null) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->setConfig($option, $new); } @@ -501,7 +501,7 @@ function xoops_getModuleOption($option, $dirname = '') { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getModuleConfig($option, $dirname); } @@ -514,7 +514,7 @@ function xoops_getBaseDomain($url, $debug = 0) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getBaseDomain($url, $debug); } @@ -526,7 +526,7 @@ function xoops_getUrlDomain($url) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getUrlDomain($url); } @@ -540,7 +540,7 @@ function xoops_template_touch($tpl_id, $clear_old = true) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->templateTouch($tpl_id); } @@ -553,6 +553,6 @@ function xoops_template_clear_module_cache($mid) { $xoops = Xoops::getInstance(); - $xoops->logger()->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->templateClearModuleCache($mid); } \ No newline at end of file Modified: 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/protector/admin/prefix_manager.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/admin/prefix_manager.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -23,6 +23,7 @@ require_once dirname(dirname(__FILE__)) . '/class/gtickets.php'; $db = XoopsDatabaseFactory::getDatabaseConnection(); +$xoops = Xoops::getInstance(); $xoops->header('protector_prefix.html'); $error = ''; @@ -82,7 +83,9 @@ } } - $_SESSION['protector_logger'] = $xoops->logger()->dump('queries'); + if ($xoops->isActiveModule('logger')) { + $_SESSION['protector_logger'] = Logger::getInstance()->dump('queries'); + } if ( $error != '' ) { $xoops->tpl()->assign('error', $error); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -88,7 +88,7 @@ break; case 'rename': - $xoops->logger()->disable(); + $xoops->disableErrorReporting(); $mid = $system->cleanVars($_POST, 'id', 0, 'int'); $value = $system->cleanVars($_POST, 'value', '', 'string'); @@ -125,7 +125,7 @@ break; case 'active': - $xoops->logger()->disable(); + $xoops->disableErrorReporting(); // Get module handler $module_handler = $xoops->getHandlerModule(); $block_handler = $xoops->getHandlerBlock(); @@ -151,7 +151,7 @@ break; case 'display_in_menu': - $xoops->logger()->disable(); + $xoops->disableErrorReporting(); // Get module handler $module_handler = $xoops->getHandlerModule(); $module_id = $system->cleanVars($_POST, 'mid', 0, 'int'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/jquery.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/jquery.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/jquery.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -22,13 +22,12 @@ include dirname(dirname(dirname(__FILE__))) . '/header.php'; $xoops = Xoops::getInstance(); +$xoops->disableErrorReporting(); if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { exit(_NOPERM); } -$xoops->logger()->disable(); - include_once $xoops->path('modules/system/functions.php'); system_loadLanguage('tplsets', 'system'); @@ -38,8 +37,6 @@ @$op = "default"; } -$xoops->logger()->usePopup = true; - switch ($op) { // Display tree folder case "tpls_display_folder": Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/jquery.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/jquery.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/jquery.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -28,7 +28,7 @@ exit(_NOPERM); } -$xoops->logger()->disable(); +$xoops->disableErrorReporting(); if (isset($_REQUEST["op"])) { $op = $_REQUEST["op"]; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/preloads/core.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/preloads/core.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/preloads/core.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -164,4 +164,47 @@ $isCached = $args[1]; XoopsLogger::getInstance()->addBlock($block->getVar('name'), $isCached, $block->getVar('bcachetime')); } + + static function eventCoreDeprecated($args) + { + $message = $args[0]; + XoopsLogger::getInstance()->addDeprecated($message); + } + + static function eventCoreDisableerrorreporting($args) + { + XoopsLogger::getInstance()->disable(); + } + + static function eventCoreIncludeCommonConfigsSuccess($args) + { + $xoops = Xoops::getInstance(); + $logger = XoopsLogger::getInstance(); + if ($xoops->getConfig('debug_mode') == 1 || $xoops->getConfig('debug_mode') == 2) { + $xoops->loadLanguage('logger'); + $logger->enable(); + $logger->usePopup = ($xoops->getConfig('debug_mode') == 2); + } else { + $xoops->disableErrorReporting(); + } + } + + static function eventCoreIncludeCommonAuthSuccess($args) + { + $xoops = Xoops::getInstance(); + $logger = XoopsLogger::getInstance(); + if ($logger->isEnable()) { + $level = $xoops->getConfig('debugLevel') ? $xoops->getConfig('debugLevel') : 0; + if (($level == 2 && !$xoops->userIsAdmin) || ($level == 1 && !$xoops->isUser())) { + $xoops->disableErrorReporting(); + } + } + } + + static function eventCoreIncludeEnd($args) + { + $logger = XoopsLogger::getInstance(); + $logger->stopTime('XOOPS Boot'); + $logger->startTime('Module init'); + } } Modified: 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 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Pdf.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -43,7 +43,7 @@ )) { $xoops = Xoops::getInstance(); - $xoops->logger()->disable(); + $xoops->disableErrorReporting(); parent::__construct($orientation, $format, $langue, $unicode, $encoding, $marges = array(5, 5, 5, 8)); } 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-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php 2012-12-08 19:11:36 UTC (rev 10330) @@ -1857,4 +1857,23 @@ } return $aReturn; } + + /** + * Support for deprecated messages events + * + * @param $message + */ + public function deprecated($message) + { + $this->preload()->triggerEvent('core.deprecated', array($message)); + } + + /** + * Support for disabling error reporting + */ + public function disableErrorReporting() + { + error_reporting(0); + $this->preload()->triggerEvent('core.disableerrorreporting'); + } } \ No newline at end of file |
From: <tr...@us...> - 2012-12-09 20:07:52
|
Revision: 10339 http://sourceforge.net/p/xoops/svn/10339 Author: trabis Date: 2012-12-09 20:07:47 +0000 (Sun, 09 Dec 2012) Log Message: ----------- Adding pdf module Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/pdf.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_class/myPdf.class.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_tcpdf_5.0.002/2dbarcodes.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_tcpdf_5.0.002/fonts/arialunicid0.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_tcpdf_5.0.002/tcpdf.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/bookmark.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple00.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple01.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple02.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple03.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple04.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple05.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple06.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple07.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple08.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple09.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple10.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple11.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple12.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple13.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/forms.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/groups.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/js1.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/js2.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/js3.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/qrcode.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/radius.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/regle.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/svg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/svg_tiger.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/svg_tree.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/ticket.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/utf8.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/html2pdf.class.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/class/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/class/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/class/pdf.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/logo_large.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/logo_small.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/images/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/images/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/images/logo.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/modinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/preloads/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/preloads/core.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/preloads/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/xoops_version.php Removed Paths: ------------- 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/ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/pdf.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/pdf.php 2012-12-09 19:30:14 UTC (rev 10338) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/pdf.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -25,7 +25,13 @@ $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'); +if ($xoops->isActiveModule('pdf')) { + $pdf = new Pdf(); + $pdf->writeHtml($content2, false); + $pdf->Output('example.pdf'); +} else { + $xoops->header(); + echo 'Oops, Please install pdf module!'; + $xoops->footer(); +} Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/class/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/class/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/class/index.html 2012-12-09 20:07:47 UTC (rev 10339) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Copied: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/class/pdf.php (from rev 10330, XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Pdf.php) =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/class/pdf.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/class/pdf.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -0,0 +1,57 @@ +<?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 pdf + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +include_once dirname(dirname(__FILE__)) . '/html2pdf/html2pdf.class.php'; + +class 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(); + $xoops->disableErrorReporting(); + + 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 Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_class/myPdf.class.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_class/myPdf.class.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_class/myPdf.class.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -9,7 +9,7 @@ * @version 4.03 */ -require_once(dirname(__FILE__).'/tcpdfConfig.php'); +require_once(dirname(__FILE__) . '/tcpdfConfig.php'); require_once(dirname(__FILE__).'/../_tcpdf_'.HTML2PDF_USED_TCPDF_VERSION.'/tcpdf.php'); class HTML2PDF_myPdf extends TCPDF Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_tcpdf_5.0.002/2dbarcodes.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/2dbarcodes.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_tcpdf_5.0.002/2dbarcodes.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -100,7 +100,7 @@ $qrtype = strtoupper($mode[0]); switch ($qrtype) { case 'QRCODE': { // QR-CODE - require_once(dirname(__FILE__).'/qrcode.php'); + require_once(dirname(__FILE__) . '/qrcode.php'); if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) { $mode[1] = 'L'; // Ddefault: Low error correction } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/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/arialunicid0.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_tcpdf_5.0.002/fonts/arialunicid0.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -3,7 +3,7 @@ $name='ArialUnicodeMS'; $desc=array('Ascent'=>1069,'Descent'=>-271,'CapHeight'=>1069,'Flags'=>32,'FontBBox'=>'[-1011 -330 2260 1078]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); $up=-100; -$ut=50; +$ut=50; $dw=1000; $cw=array( 32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278, @@ -1742,27 +1742,27 @@ 40853=>1000,40854=>1000,40855=>1000,40856=>1000,40857=>1000,40858=>1000,40859=>1000,40860=>1000,40861=>1000,40862=>1000,40863=>1000,40864=>1000,40865=>1000,40866=>1000,40867=>1000,40868=>1000, 40869=>1000); $diff=''; -$originalsize=23275812; - -// CID Information -// Select your language -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in ac16.tar.Z,ag15.tar.Z,ak12.tar.Z and aj16.tar.Z. - -//$enc='UniCNS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'CNS1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ac15.php'); - -//$enc='UniGB-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'GB1','Supplement'=>2); -//include(dirname(__FILE__).'/uni2cid_ag15.php'); - -//$enc='UniKS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Korea1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ak12.php'); - -$enc='UniJIS-UTF16-H'; -$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Japan1','Supplement'=>5); -include(dirname(__FILE__).'/uni2cid_aj16.php'); -?> +$originalsize=23275812; + +// CID Information +// Select your language +// unicode to cid conversion table is from +// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ +// cid2code.txt in ac16.tar.Z,ag15.tar.Z,ak12.tar.Z and aj16.tar.Z. + +//$enc='UniCNS-UTF16-H'; +//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'CNS1','Supplement'=>0); +//include(dirname(__FILE__).'/uni2cid_ac15.php'); + +//$enc='UniGB-UTF16-H'; +//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'GB1','Supplement'=>2); +//include(dirname(__FILE__).'/uni2cid_ag15.php'); + +//$enc='UniKS-UTF16-H'; +//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Korea1','Supplement'=>0); +//include(dirname(__FILE__).'/uni2cid_ak12.php'); + +$enc='UniJIS-UTF16-H'; +$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Japan1','Supplement'=>5); +include(dirname(__FILE__) . '/uni2cid_aj16.php'); +?> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_tcpdf_5.0.002/tcpdf.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/_tcpdf_5.0.002/tcpdf.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/_tcpdf_5.0.002/tcpdf.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -128,19 +128,19 @@ /** * main configuration file */ -require_once(dirname(__FILE__).'/config/tcpdf_config.php'); +require_once(dirname(__FILE__) . '/config/tcpdf_config.php'); // includes some support files /** * unicode data */ -require_once(dirname(__FILE__).'/unicode_data.php'); +require_once(dirname(__FILE__) . '/unicode_data.php'); /** * html colors table */ -require_once(dirname(__FILE__).'/htmlcolors.php'); +require_once(dirname(__FILE__) . '/htmlcolors.php'); if (!class_exists('TCPDF', false)) { /** @@ -12714,9 +12714,9 @@ $lastcols = $num_cols - 1; for ($i = 1; $i < $num_cols; ++$i) { $functions .= ($fc + $i).' 0 R '; - if ($i < $lastcols) { + if ($i < $lastcols) { $bounds .= sprintf('%.3F ', $grad['colors'][$i]['offset']); - } + } $encode .= '0 1 '; } $out .= ' /Functions ['.trim($functions).']'; @@ -13245,7 +13245,7 @@ if ($this->empty_string($code)) { return; } - require_once(dirname(__FILE__).'/barcodes.php'); + require_once(dirname(__FILE__) . '/barcodes.php'); // save current graphic settings $gvars = $this->getGraphicVars(); // create new barcode object @@ -13506,7 +13506,7 @@ if ($this->empty_string($code)) { return; } - require_once(dirname(__FILE__).'/2dbarcodes.php'); + require_once(dirname(__FILE__) . '/2dbarcodes.php'); // save current graphic settings $gvars = $this->getGraphicVars(); // create new barcode object @@ -18547,22 +18547,22 @@ $e = $ox * $this->k * (1 - $svgscale_x); $f = ($this->h - $oy) * $this->k * (1 - $svgscale_y); $this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', $svgscale_x, 0, 0, $svgscale_y, $e + $svgoffset_x, $f + $svgoffset_y)); - // creates a new XML parser to be used by the other XML functions - $this->parser = xml_parser_create('UTF-8'); - // the following function allows to use parser inside object - xml_set_object($this->parser, $this); - // disable case-folding for this XML parser - xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); - // sets the element handler functions for the XML parser + // creates a new XML parser to be used by the other XML functions + $this->parser = xml_parser_create('UTF-8'); + // the following function allows to use parser inside object + xml_set_object($this->parser, $this); + // disable case-folding for this XML parser + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + // sets the element handler functions for the XML parser xml_set_element_handler($this->parser, 'startSVGElementHandler', 'endSVGElementHandler'); - // sets the character data handler function for the XML parser - xml_set_character_data_handler($this->parser, 'segSVGContentHandler'); - // start parsing an XML document - if(!xml_parse($this->parser, $svgdata)) { + // sets the character data handler function for the XML parser + xml_set_character_data_handler($this->parser, 'segSVGContentHandler'); + // start parsing an XML document + if(!xml_parse($this->parser, $svgdata)) { $error_message = sprintf("SVG Error: %s at line %d", xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser)); - $this->Error($error_message); - } - // free this XML parser + $this->Error($error_message); + } + // free this XML parser xml_parser_free($this->parser); // restore previous graphic state $this->_out($this->epsmarker.'Q'); @@ -18611,14 +18611,14 @@ $this->endlinex = $this->img_rb_x; } - /** - * Get the tranformation matrix from SVG transform attribute - * @param string transformation - * @return array of transformations + /** + * Get the tranformation matrix from SVG transform attribute + * @param string transformation + * @return array of transformations * @author Nicola Asuni * @since 5.0.000 (2010-05-02) - * @access protected - */ + * @access protected + */ protected function getSVGTransformMatrix($attribute) { // identity matrix $tm = array(1, 0, 0, 1, 0, 0); @@ -18714,15 +18714,15 @@ return $tm; } - /** - * Get the product of two SVG tranformation matrices + /** + * Get the product of two SVG tranformation matrices * @param array $ta first SVG tranformation matrix - * @param array $tb second SVG tranformation matrix - * @return transformation array + * @param array $tb second SVG tranformation matrix + * @return transformation array * @author Nicola Asuni * @since 5.0.000 (2010-05-02) - * @access protected - */ + * @access protected + */ protected function getTransformationMatrixProduct($ta, $tb) { $tm = array(); $tm[0] = ($ta[0] * $tb[0]) + ($ta[2] * $tb[1]); @@ -18765,8 +18765,8 @@ $this->Transform($this->convertSVGtMatrix($tm)); } - /** - * Apply the requested SVG styles (*** TO BE COMPLETED ***) + /** + * Apply the requested SVG styles (*** TO BE COMPLETED ***) * @param array $svgstyle array of SVG styles to apply * @param array $prevsvgstyle array of previous SVG style * @param int $x X origin of the bounding box @@ -18775,11 +18775,11 @@ * @param int $h height of the bounding box * @param string $clip_function clip function * @param array $clip_params array of parameters for clipping function - * @return object style + * @return object style * @author Nicola Asuni * @since 5.0.000 (2010-05-02) - * @access protected - */ + * @access protected + */ protected function setSVGStyles($svgstyle, $prevsvgstyle, $x=0, $y=0, $w=1, $h=1, $clip_function='', $clip_params=array()) { $objstyle = ''; if(!isset($svgstyle['opacity'])) { @@ -19018,8 +19018,8 @@ return $objstyle; } - /** - * Draws an SVG path + /** + * Draws an SVG path * @param string $d attribute d of the path SVG element * @param string $style Style of rendering. Possible values are: * <ul> @@ -19031,11 +19031,11 @@ * <li>CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).</li> * <li>CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).</li> * </ul> - * @return array of container box measures (x, y, w, h) + * @return array of container box measures (x, y, w, h) * @author Nicola Asuni * @since 5.0.000 (2010-05-02) - * @access protected - */ + * @access protected + */ protected function SVGPath($d, $style='') { // set fill/stroke style $op = $this->getPathPaintOperator($style, ''); @@ -19344,16 +19344,16 @@ return array($xmin, $ymin, ($xmax - $xmin), ($ymax - $ymin)); } - /** - * Returns the angle in radiants between two vectors + /** + * Returns the angle in radiants between two vectors * @param int $x1 X coordiante of first vector point * @param int $y1 Y coordiante of first vector point * @param int $x2 X coordiante of second vector point - * @param int $y2 Y coordiante of second vector point + * @param int $y2 Y coordiante of second vector point * @author Nicola Asuni * @since 5.0.000 (2010-05-04) - * @access protected - */ + * @access protected + */ protected function getVectorsAngle($x1, $y1, $x2, $y2) { $dprod = ($x1 * $x2) + ($y1 * $y2); $dist1 = sqrt(($x1 * $x1) + ($y1 * $y1)); @@ -19368,15 +19368,15 @@ return $angle; } - /** - * Sets the opening SVG element handler function for the XML parser. (*** TO BE COMPLETED ***) - * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. - * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. - * @param array $attribs The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on. + /** + * Sets the opening SVG element handler function for the XML parser. (*** TO BE COMPLETED ***) + * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. + * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. + * @param array $attribs The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on. * @author Nicola Asuni * @since 5.0.000 (2010-05-02) - * @access protected - */ + * @access protected + */ protected function startSVGElementHandler($parser, $name, $attribs) { // check if we are in clip mode if ($this->svgclipmode) { @@ -19393,7 +19393,7 @@ $clipping = true; } // get styling properties - $prev_svgstyle = $this->svgstyles[(count($this->svgstyles) - 1)]; // previous style + $prev_svgstyle = $this->svgstyles[(count($this->svgstyles) - 1)]; // previous style $svgstyle = array(); // current style if (isset($attribs['style'])) { $attribs['style'] = ';'.$attribs['style']; @@ -19435,10 +19435,10 @@ } $svgstyle['transfmatrix'] = $tm; // process tag - switch($name) { - case 'defs': { - $this->svgdefsmode = true; - break; + switch($name) { + case 'defs': { + $this->svgdefsmode = true; + break; } // clipPath case 'clipPath': { @@ -19447,16 +19447,16 @@ $this->svgclippaths[$this->svgclipid] = array(); break; } - case 'svg': { - // start of SVG object - break; - } - case 'g': { - // group together related graphics elements + case 'svg': { + // start of SVG object + break; + } + case 'g': { + // group together related graphics elements array_push($this->svgstyles, $svgstyle); $this->StartTransform(); - $this->setSVGStyles($svgstyle, $prev_svgstyle); - break; + $this->setSVGStyles($svgstyle, $prev_svgstyle); + break; } case 'linearGradient': { $this->svggradientid = $attribs['id']; @@ -19753,26 +19753,26 @@ $this->startSVGElementHandler($parser, $use['name'], $use['attribs']); } break; - } - default: { - break; - } - } - } - - /** - * Sets the closing SVG element handler function for the XML parser. - * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. - * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. + } + default: { + break; + } + } + } + + /** + * Sets the closing SVG element handler function for the XML parser. + * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. + * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. * @author Nicola Asuni * @since 5.0.000 (2010-05-02) - * @access protected - */ - protected function endSVGElementHandler($parser, $name) { + * @access protected + */ + protected function endSVGElementHandler($parser, $name) { switch($name) { - case 'defs': { - $this->svgdefsmode = false; - break; + case 'defs': { + $this->svgdefsmode = false; + break; } // clipPath case 'clipPath': { @@ -19780,34 +19780,34 @@ break; } case 'g': { - // ungroup: remove last style from array + // ungroup: remove last style from array array_pop($this->svgstyles); - $this->StopTransform(); - break; + $this->StopTransform(); + break; } case 'text': - case 'tspan': { + case 'tspan': { // print text $this->Cell(0, 0, trim($this->svgtext), 0, 0, '', 0, '', 0, false, 'L', 'T'); - $this->StopTransform(); - break; - } - default: { - break; - } - } + $this->StopTransform(); + break; + } + default: { + break; + } + } } - - /** - * Sets the character data handler function for the XML parser. - * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. - * @param string $data The second parameter, data, contains the character data as a string. + + /** + * Sets the character data handler function for the XML parser. + * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. + * @param string $data The second parameter, data, contains the character data as a string. * @author Nicola Asuni * @since 5.0.000 (2010-05-02) - * @access protected - */ - protected function segSVGContentHandler($parser, $data) { - $this->svgtext .= $data; + * @access protected + */ + protected function segSVGContentHandler($parser, $data) { + $this->svgtext .= $data; } } // END OF TCPDF CLASS Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/about.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/about.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/about.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -10,7 +10,7 @@ * isset($_GET['vuehtml']) is not mandatory * it allow to display the result in the HTML format */ - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); // get the HTML ob_start(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/bookmark.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/bookmark.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/bookmark.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -97,7 +97,7 @@ <?php $content = ob_get_clean(); - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple00.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple00.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple00.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple00.php'); + include(dirname(__FILE__) . '/res/exemple00.php'); $content = ob_get_clean(); // convert in PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple01.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple01.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple01.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple01.php'); + include(dirname(__FILE__) . '/res/exemple01.php'); $content = ob_get_clean(); // convert in PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple02.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple02.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple02.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple02.php'); + include(dirname(__FILE__) . '/res/exemple02.php'); $content = ob_get_clean(); // convert in PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', array(15, 5, 15, 5)); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple03.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple03.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple03.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple03.php'); + include(dirname(__FILE__) . '/res/exemple03.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 3); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple04.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple04.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple04.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple04.php'); + include(dirname(__FILE__) . '/res/exemple04.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple05.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple05.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple05.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple05.php'); + include(dirname(__FILE__) . '/res/exemple05.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple06.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple06.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple06.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple06.php'); + include(dirname(__FILE__) . '/res/exemple06.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple07.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple07.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple07.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,12 +13,12 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple07a.php'); - include(dirname(__FILE__).'/res/exemple07b.php'); + include(dirname(__FILE__) . '/res/exemple07a.php'); + include(dirname(__FILE__) . '/res/exemple07b.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple08.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple08.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple08.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple08.php'); + include(dirname(__FILE__) . '/res/exemple08.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple09.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple09.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple09.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -51,7 +51,7 @@ <?php if ($generate) { $content = ob_get_clean(); - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple10.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple10.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple10.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -12,10 +12,10 @@ */ ob_start(); - include(dirname(__FILE__).'/res/exemple10.php'); + include(dirname(__FILE__) . '/res/exemple10.php'); $content = ob_get_clean(); - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple11.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple11.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple11.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple11.php'); + include(dirname(__FILE__) . '/res/exemple11.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple12.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple12.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple12.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple12.php'); + include(dirname(__FILE__) . '/res/exemple12.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple13.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/exemple13.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/exemple13.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/exemple13.php'); + include(dirname(__FILE__) . '/res/exemple13.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/forms.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/forms.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/forms.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -21,11 +21,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/forms.php'); + include(dirname(__FILE__) . '/res/forms.php'); $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/groups.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/groups.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/groups.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -57,7 +57,7 @@ <?php $content = ob_get_clean(); - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/js1.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/js1.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/js1.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -23,7 +23,7 @@ $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/js2.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/js2.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/js2.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -23,7 +23,7 @@ $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/js3.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/js3.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/js3.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -29,7 +29,7 @@ "; // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/qrcode.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/qrcode.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/qrcode.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -51,7 +51,7 @@ $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/radius.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/radius.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/radius.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -40,7 +40,7 @@ $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/regle.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/regle.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/regle.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -45,7 +45,7 @@ $content = ob_get_clean(); // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('L', 'A4', 'fr', true, 'UTF-8', 10); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/svg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/svg.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/svg.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -13,11 +13,11 @@ // get the HTML ob_start(); - include(dirname(__FILE__).'/res/svg.php'); + include(dirname(__FILE__) . '/res/svg.php'); $content = ob_get_clean(); // convert into PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/svg_tiger.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/svg_tiger.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/svg_tiger.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -260,7 +260,7 @@ </page>'; // convert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('L', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/svg_tree.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/svg_tree.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/svg_tree.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -126,7 +126,7 @@ </page>'; // onvert to PDF - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/ticket.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/ticket.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/ticket.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -43,7 +43,7 @@ </div> <h1>Billet soirée spécial HTML2PDF</h1> <b>Valable le <?php echo $date; ?> à 20h30</b><br> - <img src="./res/logo.gif" alt="logo" style="margin-top: 3mm; margin-left: 20mm"> + <img src="res/logo.gif" alt="logo" style="margin-top: 3mm; margin-left: 20mm"> </div> </td> </tr> @@ -83,7 +83,7 @@ $content = ob_get_clean(); // convert - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/utf8.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/examples/utf8.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/examples/utf8.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -11,7 +11,7 @@ * it allow to display the result in the HTML format */ - require_once(dirname(__FILE__).'/../html2pdf.class.php'); + require_once(dirname(__FILE__) . '/../html2pdf.class.php'); // get the HTML $content = file_get_contents(dirname(__FILE__).'/../_tcpdf_'.HTML2PDF_USED_TCPDF_VERSION.'/cache/utf8test.txt'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/html2pdf.class.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/html2pdf/html2pdf.class.php 2012-12-08 01:46:05 UTC (rev 10329) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/html2pdf/html2pdf.class.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -14,11 +14,11 @@ define('__CLASS_HTML2PDF__', '4.03'); define('HTML2PDF_USED_TCPDF_VERSION', '5.0.002'); - require_once(dirname(__FILE__).'/_class/exception.class.php'); - require_once(dirname(__FILE__).'/_class/locale.class.php'); - require_once(dirname(__FILE__).'/_class/myPdf.class.php'); - require_once(dirname(__FILE__).'/_class/parsingHtml.class.php'); - require_once(dirname(__FILE__).'/_class/parsingCss.class.php'); + require_once(dirname(__FILE__) . '/_class/exception.class.php'); + require_once(dirname(__FILE__) . '/_class/locale.class.php'); + require_once(dirname(__FILE__) . '/_class/myPdf.class.php'); + require_once(dirname(__FILE__) . '/_class/parsingHtml.class.php'); + require_once(dirname(__FILE__) . '/_class/parsingCss.class.php'); class HTML2PDF { Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/index.html 2012-12-09 20:07:47 UTC (rev 10339) @@ -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/pdf/icons/logo_large.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/logo_large.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/logo_small.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/icons/logo_small.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/images/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/images/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/images/index.html 2012-12-09 20:07:47 UTC (rev 10339) @@ -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/pdf/images/logo.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/images/logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Copied: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/index.html (from rev 10336, XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/index.html) =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/index.html 2012-12-09 20:07:47 UTC (rev 10339) @@ -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/pdf/language/english/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/index.html 2012-12-09 20:07:47 UTC (rev 10339) @@ -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/pdf/language/english/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/main.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/main.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -0,0 +1,19 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/main.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: svn:eol-style + native Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/modinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/modinfo.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/modinfo.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -0,0 +1,22 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +define('_MI_PDF_NAME', 'Pdf'); +define('_MI_PDF_DSC', 'Support for pdf creation'); \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/english/modinfo.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: svn:eol-style + native Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/language/index.html 2012-12-09 20:07:47 UTC (rev 10339) @@ -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/pdf/preloads/core.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/preloads/core.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/preloads/core.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -0,0 +1,37 @@ +<?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 pdf + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * Pdf core preloads + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author trabis <lus...@gm...> + */ +class PdfCorePreload extends XoopsPreloadItem +{ + + static function eventCoreIncludeCommonEnd($args) + { + XoopsLoad::addMap(array('pdf' => dirname(dirname(__FILE__)) . '/class/pdf.php')); + } + +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/preloads/core.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: svn:eol-style + native Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/preloads/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/preloads/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/preloads/index.html 2012-12-09 20:07:47 UTC (rev 10339) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Copied: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/xoops_version.php (from rev 10336, XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/xoops_version.php) =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/xoops_version.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/xoops_version.php 2012-12-09 20:07:47 UTC (rev 10339) @@ -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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package logger + * @author trabis <lus...@gm...>... [truncated message content] |
From: <tr...@us...> - 2012-12-09 20:52:13
|
Revision: 10341 http://sourceforge.net/p/xoops/svn/10341 Author: trabis Date: 2012-12-09 20:52:09 +0000 (Sun, 09 Dec 2012) Log Message: ----------- Deleting examples folder and updating modules descriptions Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/language/english/modinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/xoops_version.php Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/language/english/modinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/language/english/modinfo.php 2012-12-09 20:51:26 UTC (rev 10340) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/language/english/modinfo.php 2012-12-09 20:52:09 UTC (rev 10341) @@ -19,7 +19,7 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); define('_MI_LOGGER_NAME', 'Logger'); -define('_MI_LOGGER_DSC', ''); +define('_MI_LOGGER_DSC', 'Error reporting and performance analysis'); define('_MI_LOGGER_DEBUGMODE' , "Debug Mode"); define('_MI_LOGGER_DEBUGMODE0', "Off"); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/xoops_version.php 2012-12-09 20:51:26 UTC (rev 10340) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pdf/xoops_version.php 2012-12-09 20:52:09 UTC (rev 10341) @@ -12,7 +12,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) - * @package logger + * @package pdf * @author trabis <lus...@gm...> * @version $Id$ */ |
From: <tr...@us...> - 2012-12-10 00:22:51
|
Revision: 10343 http://sourceforge.net/p/xoops/svn/10343 Author: trabis Date: 2012-12-10 00:22:48 +0000 (Mon, 10 Dec 2012) Log Message: ----------- Module Codex - Showing files content along with the examples Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/cache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/form.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/pdf.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/cache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/cache.php 2012-12-09 21:20:35 UTC (rev 10342) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/cache.php 2012-12-10 00:22:48 UTC (rev 10343) @@ -55,4 +55,6 @@ echo $ret . '<br />'; echo '<a href="?nodelete">Refresh</a> - <a href="?delete">Delete caches</a>'; + +Xoops_Debug::dumpFile(__FILE__ ); $xoops->footer(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/form.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/form.php 2012-12-09 21:20:35 UTC (rev 10342) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/form.php 2012-12-10 00:22:48 UTC (rev 10343) @@ -20,6 +20,7 @@ $xoops = Xoops::getInstance(); $xoops->header(); + // Form Horizontal $form = new XoopsThemeForm('Form Horizontal', 'form_horizontal', 'testform.php', 'post', true, 'horizontal'); @@ -137,4 +138,6 @@ $form->addElement($button_tray); $form->display(); + +Xoops_Debug::dumpFile(__FILE__ ); $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/pdf.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/pdf.php 2012-12-09 21:20:35 UTC (rev 10342) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/codex/pdf.php 2012-12-10 00:22:48 UTC (rev 10343) @@ -20,19 +20,27 @@ $xoops = Xoops::getInstance(); -$content = Xoops_Debug::dump($xoops->getConfigs(), false); +if (isset($_GET['pdf'])) { + $content = Xoops_Debug::dump($xoops->getConfigs(), false); -$tpl = new XoopsTpl(); -$tpl->assign('dummy_content' , $content); -$content2 = $tpl->fetch('module:system|system_dummy.html'); + $tpl = new XoopsTpl(); + $tpl->assign('dummy_content' , $content); + $content2 = $tpl->fetch('module:system|system_dummy.html'); -if ($xoops->isActiveModule('pdf')) { - $pdf = new Pdf(); - $pdf->writeHtml($content2, false); - $pdf->Output('example.pdf'); + if ($xoops->isActiveModule('pdf')) { + $pdf = new Pdf(); + $pdf->writeHtml($content2, false); + $pdf->Output('example.pdf'); + } else { + $xoops->header(); + echo 'Oops, Please install pdf module!'; + Xoops_Debug::dumpFile(__FILE__ ); + $xoops->footer(); + } } else { $xoops->header(); - echo 'Oops, Please install pdf module!'; + echo '<a href="?pdf">Make Pdf</a>'; + Xoops_Debug::dumpFile(__FILE__ ); $xoops->footer(); } 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-09 21:20:35 UTC (rev 10342) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Debug.php 2012-12-10 00:22:48 UTC (rev 10343) @@ -47,4 +47,27 @@ } return $msg; } + + /** + * Output a dump of a file + * + * @param mixed $file file which will be dumped + * @param bool $echo + * @param bool $exit + * + * @return string + */ + static function dumpFile($file, $echo = true, $exit = false) + { + $msg = highlight_file($file, true); + $msg = "<div style='padding: 5px; font-weight: bold'>{$msg}</div>"; + if (!$echo) { + return $msg; + } + echo $msg; + if ($exit) { + die(); + } + return $msg; + } } \ No newline at end of file |