From f9d232c10a95ff26bb8bf422881a1fd44f9bf07e Mon Sep 17 00:00:00 2001 From: oldperl Date: Thu, 12 Jan 2017 23:36:25 +0000 Subject: [PATCH] remove deprecated constructors --- .../conlite/classes/contenido/class.area.php | 34 ++---- .../classes/contenido/class.article.php | 27 +---- .../contenido/class.articlelanguage.php | 14 --- .../classes/contenido/class.category.php | 26 +---- .../contenido/class.categoryarticle.php | 26 +---- .../contenido/class.categorylanguage.php | 41 ++----- .../classes/contenido/class.categorytree.php | 28 +---- .../classes/contenido/class.client.php | 84 +++++--------- .../classes/contenido/class.container.php | 37 ++---- .../contenido/class.containerconfig.php | 33 ++---- .../conlite/classes/contenido/class.file.php | 31 ++--- .../classes/contenido/class.framefile.php | 32 ++---- .../classes/contenido/class.language.php | 47 +++----- .../classes/contenido/class.layout.php | 6 - .../classes/contenido/class.template.php | 35 ++---- .../contenido/class.templateconfig.php | 40 ++----- .../conlite/classes/contenido/class.user.php | 106 +++++++----------- 17 files changed, 176 insertions(+), 471 deletions(-) diff --git a/trunk/conlite/classes/contenido/class.area.php b/trunk/conlite/classes/contenido/class.area.php index 54b733e..b0797f4 100644 --- a/trunk/conlite/classes/contenido/class.area.php +++ b/trunk/conlite/classes/contenido/class.area.php @@ -1,4 +1,5 @@ _setItemClass("cApiArea"); } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiAreaCollection() - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct(); - } } +class cApiArea extends Item { -class cApiArea extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg['tab']['area'], 'idarea'); $this->setFilters(array("addslashes"), array("stripslashes")); @@ -61,15 +51,7 @@ class cApiArea extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiArea($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } - - public function create($name, $parentid = 0, $relevant = 1, $online = 1) - { + public function create($name, $parentid = 0, $relevant = 1, $online = 1) { $item = parent::createNewItem(); $item->set("name", $name); @@ -82,11 +64,11 @@ class cApiArea extends Item return ($item); } - public function createAction($area, $name, $code, $location, $relevant) - { + public function createAction($area, $name, $code, $location, $relevant) { $ac = new cApiActionCollection(); $a = $ac->create($area, $name, $code, $location, $relevant); } + } ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.article.php b/trunk/conlite/classes/contenido/class.article.php index 4d4a641..f859e14 100644 --- a/trunk/conlite/classes/contenido/class.article.php +++ b/trunk/conlite/classes/contenido/class.article.php @@ -1,4 +1,5 @@ _setItemClass("cApiArticle"); @@ -39,23 +38,15 @@ class cApiArticleCollection extends ItemCollection } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiArticleCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select); - } } +class cApiArticle extends Item { -class cApiArticle extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["art"], "idart"); $this->setFilters(array(), array()); @@ -64,12 +55,6 @@ class cApiArticle extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiArticle($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.articlelanguage.php b/trunk/conlite/classes/contenido/class.articlelanguage.php index 066485a..c00570f 100644 --- a/trunk/conlite/classes/contenido/class.articlelanguage.php +++ b/trunk/conlite/classes/contenido/class.articlelanguage.php @@ -36,13 +36,6 @@ class cApiArticleLanguageCollection extends ItemCollection { $this->select($select); } } - - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiArticleLanguageCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select); - } public function getIdArtLang($iIdart, $iIdlang) { $this->setWhere('idart', Contenido_Security::toInteger($iIdart)); @@ -70,13 +63,6 @@ class cApiArticleLanguage extends Item $this->loadByPrimaryKey($mId); } } - - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiArticleLanguage($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } public function loadByArticleAndLanguageId($idart, $idlang) { $result = true; diff --git a/trunk/conlite/classes/contenido/class.category.php b/trunk/conlite/classes/contenido/class.category.php index 0319be3..2d172f2 100644 --- a/trunk/conlite/classes/contenido/class.category.php +++ b/trunk/conlite/classes/contenido/class.category.php @@ -1,4 +1,5 @@ _setItemClass("cApiCategory"); @@ -36,23 +34,15 @@ class cApiCategoryCollection extends ItemCollection } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiCategoryCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select); - } } +class cApiCategory extends Item { -class cApiCategory extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["cat"], "idcat"); $this->setFilters(array(), array()); @@ -62,12 +52,6 @@ class cApiCategory extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiCategory($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.categoryarticle.php b/trunk/conlite/classes/contenido/class.categoryarticle.php index 1aa3c6a..1dcacee 100644 --- a/trunk/conlite/classes/contenido/class.categoryarticle.php +++ b/trunk/conlite/classes/contenido/class.categoryarticle.php @@ -1,4 +1,5 @@ _setItemClass("cApiCategoryArticle"); @@ -38,23 +36,15 @@ class cApiCategoryArticleCollection extends ItemCollection } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiCategoryArticleCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select); - } } +class cApiCategoryArticle extends Item { -class cApiCategoryArticle extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["cat_art"], "idcatart"); $this->setFilters(array(), array()); @@ -63,12 +53,6 @@ class cApiCategoryArticle extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiCategoryArticle($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.categorylanguage.php b/trunk/conlite/classes/contenido/class.categorylanguage.php index 398af36..0579df5 100644 --- a/trunk/conlite/classes/contenido/class.categorylanguage.php +++ b/trunk/conlite/classes/contenido/class.categorylanguage.php @@ -1,4 +1,5 @@ _setItemClass("cApiCategoryLanguage"); @@ -36,24 +34,15 @@ class cApiCategoryLanguageCollection extends ItemCollection $this->select($select); } } - - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiCategoryLanguageCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select); - } } +class cApiCategoryLanguage extends Item { -class cApiCategoryLanguage extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["cat_lang"], "idcatlang"); $this->setFilters(array(), array()); @@ -62,15 +51,7 @@ class cApiCategoryLanguage extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiCategoryLanguage($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } - - public function setField($field, $value) - { + public function setField($field, $value, $bSafe = true) { switch ($field) { case "name": $this->setField("urlname", $value); @@ -83,8 +64,7 @@ class cApiCategoryLanguage extends Item parent::setField($field, $value); } - public function assignTemplate($idtpl) - { + public function assignTemplate($idtpl) { $c_tplcfg = new cApiTemplateConfigurationCollection(); if ($this->get("idtplcfg") != 0) { @@ -100,17 +80,16 @@ class cApiCategoryLanguage extends Item return ($tplcfg); } - public function getTemplate() - { + public function getTemplate() { $c_tplcfg = new cApiTemplateConfiguration($this->get("idtplcfg")); return ($c_tplcfg->get("idtpl")); } - public function hasStartArticle() - { + public function hasStartArticle() { cInclude("includes", "functions.str.php"); return strHasStartArticle($this->get("idcat"), $this->get("idlang")); } + } ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.categorytree.php b/trunk/conlite/classes/contenido/class.categorytree.php index 47c8e68..f5b8fc6 100644 --- a/trunk/conlite/classes/contenido/class.categorytree.php +++ b/trunk/conlite/classes/contenido/class.categorytree.php @@ -1,4 +1,5 @@ _setJoinPartner("cApiCategoryCollection"); @@ -37,23 +35,15 @@ class cApiCategoryTreeCollection extends ItemCollection } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiCategoryTreeCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select); - } } +class cApiTree extends Item { -class cApiTree extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["cat_tree"], "idtree"); $this->setFilters(array(), array()); @@ -61,13 +51,5 @@ class cApiTree extends Item $this->loadByPrimaryKey($mId); } } - - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiTree($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } - ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.client.php b/trunk/conlite/classes/contenido/class.client.php index c5f9210..43a2595 100644 --- a/trunk/conlite/classes/contenido/class.client.php +++ b/trunk/conlite/classes/contenido/class.client.php @@ -1,4 +1,5 @@ _setItemClass("cApiClient"); $this->_setJoinPartner("cApiClientLanguageCollection"); } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiClientCollection() - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct(); - } - /** * Returns all clients available in the system * * @return array Array with id and name entries */ - public function getAvailableClients() - { + public function getAvailableClients() { $aClients = array(); $this->select(); @@ -67,15 +57,14 @@ class cApiClientCollection extends ItemCollection * * @return array Array with id and name entries */ - public function getAccessibleClients() - { + public function getAccessibleClients() { global $perm; $aClients = array(); $this->select(); while ($oItem = $this->next()) { - if ($perm->have_perm_client("client[".$oItem->get('idclient')."]") || - $perm->have_perm_client("admin[".$oItem->get('idclient')."]") || - $perm->have_perm_client()) { + if ($perm->have_perm_client("client[" . $oItem->get('idclient') . "]") || + $perm->have_perm_client("admin[" . $oItem->get('idclient') . "]") || + $perm->have_perm_client()) { $aClients[$oItem->get('idclient')] = array('name' => $oItem->get('name')); } } @@ -88,8 +77,7 @@ class cApiClientCollection extends ItemCollection * @param int $iIdClient * @return string Clientname if found, or empty string if not. */ - public function getClientname($iIdClient) - { + public function getClientname($iIdClient) { $this->select("idclient='" . (int) $iIdClient . "'"); if ($oItem = $this->next()) { return $oItem->get('name'); @@ -104,8 +92,7 @@ class cApiClientCollection extends ItemCollection * @param int $iIdClient * @return bool true if the client has a language */ - public function hasLanguageAssigned($iIdClient) - { + public function hasLanguageAssigned($iIdClient) { global $cfg; $db = new DB_ConLite(); $sql = 'SELECT idlang FROM ' . $cfg['tab']['clients_lang'] . ' WHERE idclient = "' . (int) $iIdClient . '"'; @@ -116,8 +103,8 @@ class cApiClientCollection extends ItemCollection return false; } } -} +} /** * Class cApiClient @@ -125,8 +112,8 @@ class cApiClientCollection extends ItemCollection * @version 1.01 * @copyright four for business 2004 */ -class cApiClient extends Item -{ +class cApiClient extends Item { + public $idclient; /** @@ -139,8 +126,7 @@ class cApiClient extends Item * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg['tab']['clients'], 'idclient'); if ($mId !== false) { @@ -148,13 +134,6 @@ class cApiClient extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiClient($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } - /** * Static accessor to the singleton instance. * @@ -162,8 +141,7 @@ class cApiClient extends Item * @param int $iClient * @return cApiClient Reference to the singleton instance. */ - public static function getInstance($iClient = false) - { + public static function getInstance($iClient = false) { static $oCurrentInstance = array(); if (!$iClient) { @@ -184,8 +162,7 @@ class cApiClient extends Item * @param int $iIdKey * @return bool */ - public function loadByPrimaryKey($iIdKey) - { + public function loadByPrimaryKey($iIdKey) { if (parent::loadByPrimaryKey($iIdKey) == true) { $this->idclient = $iIdKey; return true; @@ -201,8 +178,7 @@ class cApiClient extends Item * @param mixed $mValue Value * @param mixed $mIdproperty */ - public function setProperty($mType, $mName, $mValue, $mIdproperty = 0) - { + public function setProperty($mType, $mName, $mValue, $mIdproperty = 0) { $oPropertyColl = $this->_getPropertiesCollectionInstance(); $oPropertyColl->setValue('clientsetting', $this->idclient, $mType, $mName, $mValue, $mIdproperty); } @@ -214,8 +190,7 @@ class cApiClient extends Item * @param mixed $mName Entry name * @return mixed Value */ - public function getProperty($mType, $mName) - { + public function getProperty($mType, $mName) { $oPropertyColl = $this->_getPropertiesCollectionInstance(); return $oPropertyColl->getValue('clientsetting', $this->idclient, $mType, $mName); } @@ -226,8 +201,7 @@ class cApiClient extends Item * @param int $iIdProp Id of property * @return void */ - public function deletePropertyById($iIdProp) - { + public function deletePropertyById($iIdProp) { $oPropertyColl = $this->_getPropertiesCollectionInstance(); $oPropertyColl->delete($iIdProp); } @@ -238,8 +212,7 @@ class cApiClient extends Item * @param mixed $mType Type of the data to get * @return array Assoziative array */ - public function getPropertiesByType($mType) - { + public function getPropertiesByType($mType) { $oPropertyColl = $this->_getPropertiesCollectionInstance(); return $oPropertyColl->getValuesByType('clientsetting', $this->idclient, $mType); } @@ -251,17 +224,16 @@ class cApiClient extends Item * @return array|false Assoziative array * @todo return value should be the same as getPropertiesByType(), e. g. an empty array instead false */ - public function getProperties() - { + public function getProperties() { $oPropertyColl = $this->_getPropertiesCollectionInstance(); - $oPropertyColl->select("itemid='".$this->idclient."' AND itemtype='clientsetting'", "", "type, name, value ASC"); + $oPropertyColl->select("itemid='" . $this->idclient . "' AND itemtype='clientsetting'", "", "type, name, value ASC"); if ($oPropertyColl->count() > 0) { $aArray = array(); while ($oItem = $oPropertyColl->next()) { - $aArray[$oItem->get('idproperty')]['type'] = $oItem->get('type'); - $aArray[$oItem->get('idproperty')]['name'] = $oItem->get('name'); + $aArray[$oItem->get('idproperty')]['type'] = $oItem->get('type'); + $aArray[$oItem->get('idproperty')]['name'] = $oItem->get('name'); $aArray[$oItem->get('idproperty')]['value'] = $oItem->get('value'); } @@ -276,8 +248,7 @@ class cApiClient extends Item * * @return bool */ - public function hasLanguages() - { + public function hasLanguages() { $cApiClientLanguageCollection = new cApiClientLanguageCollection(); $cApiClientLanguageCollection->setWhere("idclient", $this->get("idclient")); $cApiClientLanguageCollection->query(); @@ -294,8 +265,7 @@ class cApiClient extends Item * * @return PropertyCollection */ - protected function _getPropertiesCollectionInstance() - { + protected function _getPropertiesCollectionInstance() { // Runtime on-demand allocation of the properties object if (!is_object($this->_oPropertyCollection)) { $this->_oPropertyCollection = new PropertyCollection(); @@ -303,6 +273,6 @@ class cApiClient extends Item } return $this->_oPropertyCollection; } -} +} ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.container.php b/trunk/conlite/classes/contenido/class.container.php index fdaa88b..8c2c3f7 100644 --- a/trunk/conlite/classes/contenido/class.container.php +++ b/trunk/conlite/classes/contenido/class.container.php @@ -1,4 +1,5 @@ _setItemClass("cApiContainer"); @@ -36,23 +34,14 @@ class cApiContainerCollection extends ItemCollection } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiContainerCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select = false); - } - - public function clearAssignments($idtpl) - { + public function clearAssignments($idtpl) { $this->select("idtpl = '$idtpl'"); while ($item = $this->next()) { $this->delete($item->get("idcontainer")); } } - public function assignModul($idtpl, $number, $module) - { + public function assignModul($idtpl, $number, $module) { $this->select("idtpl = '$idtpl' AND number = '$number'"); if ($item = $this->next()) { $item->set("module", $module); @@ -62,25 +51,23 @@ class cApiContainerCollection extends ItemCollection } } - public function create($idtpl, $number, $module) - { + public function create($idtpl, $number, $module) { $item = parent::createNewItem(); $item->set("idtpl", $idtpl); $item->set("number", $number); $item->set("module", $module); $item->store(); } + } +class cApiContainer extends Item { -class cApiContainer extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["container"], "idcontainer"); $this->setFilters(array(), array()); @@ -89,12 +76,6 @@ class cApiContainer extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiContainer($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.containerconfig.php b/trunk/conlite/classes/contenido/class.containerconfig.php index 6f7ff36..fdd6a5c 100644 --- a/trunk/conlite/classes/contenido/class.containerconfig.php +++ b/trunk/conlite/classes/contenido/class.containerconfig.php @@ -1,4 +1,5 @@ _setItemClass("cApiContainerConfiguration"); @@ -36,32 +34,23 @@ class cApiContainerConfigurationCollection extends ItemCollection } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiContainerConfigurationCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select = false); - } - - public function create($idtplcfg, $number, $container) - { + public function create($idtplcfg, $number, $container) { $item = parent::createNewItem(); $item->set("idtplcfg", $idtplcfg); $item->set("number", $number); $item->set("container", $container); $item->store(); } + } +class cApiContainerConfiguration extends Item { -class cApiContainerConfiguration extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["container_conf"], "idcontainerc"); $this->setFilters(array(), array()); @@ -69,13 +58,5 @@ class cApiContainerConfiguration extends Item $this->loadByPrimaryKey($mId); } } - - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiContainerConfiguration($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } - ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.file.php b/trunk/conlite/classes/contenido/class.file.php index c51e8d3..a648af1 100644 --- a/trunk/conlite/classes/contenido/class.file.php +++ b/trunk/conlite/classes/contenido/class.file.php @@ -1,4 +1,5 @@ _setItemClass("cApiFile"); } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiFileCollection() - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct(); - } - - public function create($area, $filename, $filetype = "main") - { + public function create($area, $filename, $filetype = "main") { $item = parent::createNewItem(); if (is_string($area)) { @@ -72,17 +62,16 @@ class cApiFileCollection extends ItemCollection return ($item); } + } +class cApiFile extends Item { -class cApiFile extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["files"], "idfile"); $this->setFilters(array("addslashes"), array("stripslashes")); @@ -91,12 +80,6 @@ class cApiFile extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiFile($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.framefile.php b/trunk/conlite/classes/contenido/class.framefile.php index 08d6661..046cbd1 100644 --- a/trunk/conlite/classes/contenido/class.framefile.php +++ b/trunk/conlite/classes/contenido/class.framefile.php @@ -1,4 +1,5 @@ _setItemClass("cApiFrameFile"); } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiFrameFileCollection() - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct(); - } - - public function create($area, $idframe, $idfile) - { + public function create($area, $idframe, $idfile) { $item = parent::createNewItem(); if (is_string($area)) { @@ -67,17 +57,16 @@ class cApiFrameFileCollection extends ItemCollection return ($item); } + } +class cApiFrameFile extends Item { -class cApiFrameFile extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["framefiles"], "idframefile"); $this->setFilters(array("addslashes"), array("stripslashes")); @@ -86,12 +75,5 @@ class cApiFrameFile extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiFrameFile($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } - ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.language.php b/trunk/conlite/classes/contenido/class.language.php index 3b4a614..25ab4a7 100644 --- a/trunk/conlite/classes/contenido/class.language.php +++ b/trunk/conlite/classes/contenido/class.language.php @@ -1,4 +1,5 @@ _setJoinPartner("cApiClientLanguageCollection"); } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiLanguageCollection() { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct(); - } - public function nextAccessible() { global $perm, $client, $cfg, $lang; $item = parent::next(); $db = new DB_ConLite(); - $lang = Contenido_Security::toInteger($lang); + $lang = Contenido_Security::toInteger($lang); $client = Contenido_Security::toInteger($client); - $sql = "SELECT idclient FROM ".$cfg["tab"]["clients_lang"]." WHERE idlang = '".$lang."'"; + $sql = "SELECT idclient FROM " . $cfg["tab"]["clients_lang"] . " WHERE idlang = '" . $lang . "'"; $db->query($sql); if ($db->next_record()) { @@ -61,9 +54,9 @@ class cApiLanguageCollection extends ItemCollection { } if ($item) { - if ($perm->have_perm_client("lang[".$item->get("idlang")."]") || - $perm->have_perm_client("admin[".$client."]") || - $perm->have_perm_client()) { + if ($perm->have_perm_client("lang[" . $item->get("idlang") . "]") || + $perm->have_perm_client("admin[" . $client . "]") || + $perm->have_perm_client()) { // Do nothing for now } else { $item = $this->nextAccessible(); @@ -73,8 +66,8 @@ class cApiLanguageCollection extends ItemCollection { } else { return false; } - } - + } + /** * Returns an array with language ids or an array of values if $bWithValues is true * @@ -82,20 +75,20 @@ class cApiLanguageCollection extends ItemCollection { * @param boolean $bWithValues * @return array */ - public function getClientLanguages($iClient, $bWithValues=false) { + public function getClientLanguages($iClient, $bWithValues = false) { $aList = array(); $oClientLangCol = new cApiClientLanguageCollection(); $oClientLangCol->setWhere("idclient", $iClient); $oClientLangCol->query(); - - while($oItem = $oClientLangCol->next()) { + + while ($oItem = $oClientLangCol->next()) { $mTmpValues = ''; - if($bWithValues) { + if ($bWithValues) { $oLanguage = new cApiLanguage($oItem->get("idlang")); $mTmpValues = array( - "idlang" => $oItem->get("idlang"), + "idlang" => $oItem->get("idlang"), "name" => $oLanguage->get("name"), - "active" => ($oLanguage->get("active"))?true:false, + "active" => ($oLanguage->get("active")) ? true : false, "encoding" => $oLanguage->get("encoding") ); unset($oLanguage); @@ -107,11 +100,11 @@ class cApiLanguageCollection extends ItemCollection { unset($oClientLangCol, $oItem); return $aList; } + } - class cApiLanguage extends Item { - + /** * Constructor Function * @param mixed $mId Specifies the ID of item to load @@ -124,10 +117,6 @@ class cApiLanguage extends Item { } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiLanguage($mId = false) { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } + ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.layout.php b/trunk/conlite/classes/contenido/class.layout.php index 1167c4a..330a676 100644 --- a/trunk/conlite/classes/contenido/class.layout.php +++ b/trunk/conlite/classes/contenido/class.layout.php @@ -33,12 +33,6 @@ class cApiLayoutCollection extends ItemCollection { $this->_setItemClass("cApiLayout"); } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiLayoutCollection() { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct(); - } - public function create($title) { global $client; $item = parent::createNewItem(); diff --git a/trunk/conlite/classes/contenido/class.template.php b/trunk/conlite/classes/contenido/class.template.php index ac53ec7..6d62be2 100644 --- a/trunk/conlite/classes/contenido/class.template.php +++ b/trunk/conlite/classes/contenido/class.template.php @@ -1,4 +1,5 @@ _setItemClass("cApiTemplate"); @@ -36,35 +34,26 @@ class cApiTemplateCollection extends ItemCollection } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiTemplateCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select); - } - - public function setDefaultTemplate($idtpl) - { + public function setDefaultTemplate($idtpl) { global $cfg, $client; $db = new DB_ConLite(); - $sql = "UPDATE ".$cfg["tab"]["tpl"]." SET defaulttemplate = 0 WHERE idclient = '" . Contenido_Security::toInteger($client) . "'"; + $sql = "UPDATE " . $cfg["tab"]["tpl"] . " SET defaulttemplate = 0 WHERE idclient = '" . Contenido_Security::toInteger($client) . "'"; $db->query($sql); - $sql = "UPDATE ".$cfg["tab"]["tpl"]." SET defaulttemplate = 1 WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "'"; + $sql = "UPDATE " . $cfg["tab"]["tpl"] . " SET defaulttemplate = 1 WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "'"; $db->query($sql); } + } +class cApiTemplate extends Item { -class cApiTemplate extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["tpl"], "idtpl"); $this->setFilters(array(), array()); @@ -73,12 +62,6 @@ class cApiTemplate extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiTemplate($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } } ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.templateconfig.php b/trunk/conlite/classes/contenido/class.templateconfig.php index 88824fe..599a6e7 100644 --- a/trunk/conlite/classes/contenido/class.templateconfig.php +++ b/trunk/conlite/classes/contenido/class.templateconfig.php @@ -1,4 +1,5 @@ _setItemClass("cApiTemplateConfiguration"); @@ -36,29 +34,20 @@ class cApiTemplateConfigurationCollection extends ItemCollection } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function FrontendPermission($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select); - } - - public function delete($idtplcfg) - { + public function delete($idtplcfg) { $result = parent::delete($idtplcfg); - $oContainerConfCollection = new cApiContainerConfigurationCollection ("idtplcfg = '$idtplcfg'"); + $oContainerConfCollection = new cApiContainerConfigurationCollection("idtplcfg = '$idtplcfg'"); $aDelContainerConfIds = array(); while ($oContainerConf = $oContainerConfCollection->next()) { array_push($aDelContainerConfIds, $oContainerConf->get('idcontainerc')); } - foreach($aDelContainerConfIds as $iDelContainerConfId) { + foreach ($aDelContainerConfIds as $iDelContainerConfId) { $oContainerConfCollection->delete($iDelContainerConfId); } } - public function create($idtpl) - { + public function create($idtpl) { global $auth; $item = parent::createNewItem(); @@ -77,7 +66,7 @@ class cApiTemplateConfigurationCollection extends ItemCollection if ($template = $templateCollection->next()) { $idTplcfgStandard = $template->get("idtplcfg"); if ($idTplcfgStandard > 0) { - $oContainerConfCollection = new cApiContainerConfigurationCollection ("idtplcfg = '$idTplcfgStandard'"); + $oContainerConfCollection = new cApiContainerConfigurationCollection("idtplcfg = '$idTplcfgStandard'"); $aStandardconfig = array(); while ($oContainerConf = $oContainerConfCollection->next()) { $aStandardconfig[$oContainerConf->get('number')] = $oContainerConf->get('container'); @@ -91,17 +80,16 @@ class cApiTemplateConfigurationCollection extends ItemCollection return ($item); } + } +class cApiTemplateConfiguration extends Item { -class cApiTemplateConfiguration extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["tpl_conf"], "idtplcfg"); $this->setFilters(array(), array()); @@ -110,12 +98,6 @@ class cApiTemplateConfiguration extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiTemplateConfiguration($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId = false); - } } ?> \ No newline at end of file diff --git a/trunk/conlite/classes/contenido/class.user.php b/trunk/conlite/classes/contenido/class.user.php index b81879e..3c2ef61 100644 --- a/trunk/conlite/classes/contenido/class.user.php +++ b/trunk/conlite/classes/contenido/class.user.php @@ -1,4 +1,5 @@ _setItemClass("cApiUser"); @@ -36,15 +34,7 @@ class cApiUserCollection extends ItemCollection } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiUserCollection($select = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($select); - } - - public function create($username) - { + public function create($username) { $md5user = md5($username); $this->resetQuery(); @@ -62,17 +52,16 @@ class cApiUserCollection extends ItemCollection return ($item); } } + } +class cApiUser extends Item { -class cApiUser extends Item -{ /** * Constructor Function * @param mixed $mId Specifies the ID of item to load */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["phplib_auth_user_md5"], "user_id"); $this->setFilters(array(), array()); @@ -81,13 +70,6 @@ class cApiUser extends Item } } - /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - public function cApiUser($mId = false) - { - cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); - $this->__construct($mId); - } - /** * Stores the modified user object to the database * @param string type Specifies the type (class, category etc) for the property to retrieve @@ -95,8 +77,7 @@ class cApiUser extends Item * @param boolean group Specifies if this function should recursively search in groups * @return string The value of the retrieved property */ - public function getUserProperty($type, $name, $group = false) - { + public function getUserProperty($type, $name, $group = false) { global $cfg, $perm; if (!is_object($perm)) { @@ -110,8 +91,8 @@ class cApiUser extends Item if (is_array($groups)) { foreach ($groups as $value) { - $sql = "SELECT value FROM " .$cfg["tab"]["group_prop"]." - WHERE group_id = '".$value."' + $sql = "SELECT value FROM " . $cfg["tab"]["group_prop"] . " + WHERE group_id = '" . $value . "' AND type = '$type' AND name = '$name'"; $this->db->query($sql); @@ -123,7 +104,7 @@ class cApiUser extends Item } } - $sql = "SELECT value FROM " .$cfg["tab"]["user_prop"]." + $sql = "SELECT value FROM " . $cfg["tab"]["user_prop"] . " WHERE user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "' AND type = '" . Contenido_Security::escapeDB($type, $this->db) . "' AND name = '" . Contenido_Security::escapeDB($name, $this->db) . "'"; @@ -146,37 +127,36 @@ class cApiUser extends Item * @param string $sType Specifies the type (class, category etc) for the property to retrieve * @param bool $bGroup Specifies if this function should recursively search in groups * @return array The value of the retrieved property - **/ - public function getUserPropertiesByType($sType, $bGroup = false) - { - global $cfg, $perm; + * */ + public function getUserPropertiesByType($sType, $bGroup = false) { + global $cfg, $perm; - if (!is_object($perm)) { - $perm = new Contenido_Perm(); - } + if (!is_object($perm)) { + $perm = new Contenido_Perm(); + } - $aResult = array(); + $aResult = array(); - if ($bGroup == true) { - $aGroups = $perm->getGroupsForUser($this->values['user_id']); + if ($bGroup == true) { + $aGroups = $perm->getGroupsForUser($this->values['user_id']); - if (is_array($aGroups)) { - foreach ($aGroups as $iID) { - $sSQL = "SELECT name, value FROM " .$cfg["tab"]["group_prop"]." + if (is_array($aGroups)) { + foreach ($aGroups as $iID) { + $sSQL = "SELECT name, value FROM " . $cfg["tab"]["group_prop"] . " WHERE group_id = '" . Contenido_Security::escapeDB($iID, $this->db) . "' - AND type = '".Contenido_Security::escapeDB($sType, $this->db)."'"; + AND type = '" . Contenido_Security::escapeDB($sType, $this->db) . "'"; $this->db->query($sSQL); while ($this->db->next_record()) { $aResult[$this->db->f("name")] = urldecode($this->db->f("value")); } } - } - } + } + } - $sSQL = "SELECT name, value FROM " .$cfg["tab"]["user_prop"]." - WHERE user_id = '".Contenido_Security::escapeDB($this->values['user_id'], $this->db)."' - AND type = '". Contenido_Security::escapeDB($sType, $this->db) . "'"; + $sSQL = "SELECT name, value FROM " . $cfg["tab"]["user_prop"] . " + WHERE user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "' + AND type = '" . Contenido_Security::escapeDB($sType, $this->db) . "'"; $this->db->query($sSQL); while ($this->db->next_record()) { @@ -191,12 +171,11 @@ class cApiUser extends Item * * @return array|bool */ - public function getUserProperties() - { + public function getUserProperties() { global $cfg; - $sql = "SELECT type, name FROM " .$cfg["tab"]["user_prop"]." - WHERE user_id = '".Contenido_Security::escapeDB($this->values['user_id'], $this->db)."'"; + $sql = "SELECT type, name FROM " . $cfg["tab"]["user_prop"] . " + WHERE user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "'"; $this->db->query($sql); if ($this->db->num_rows() == 0) { @@ -206,7 +185,7 @@ class cApiUser extends Item $props = array(); while ($this->db->next_record()) { $props[] = array("name" => $this->db->f("name"), - "type" => $this->db->f("type")); + "type" => $this->db->f("type")); } return $props; @@ -218,27 +197,26 @@ class cApiUser extends Item * @param string name Specifies the name of the property to retrieve * @param string value Specifies the value to insert */ - public function setUserProperty($type, $name, $value) - { + public function setUserProperty($type, $name, $value) { global $cfg; $value = urlencode($value); // Check if such an entry already exists if ($this->getUserProperty($type, $name) !== false) { - $sql = "UPDATE ".$cfg["tab"]["user_prop"]." + $sql = "UPDATE " . $cfg["tab"]["user_prop"] . " SET value = '$value' - WHERE user_id = '".Contenido_Security::escapeDB($this->values['user_id'], $this->db)."' + WHERE user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "' AND type = '" . Contenido_Security::escapeDB($type, $this->db) . "' AND name = '" . Contenido_Security::escapeDB($name, $this->db) . "'"; $this->db->query($sql); } else { - $sql = "INSERT INTO ".$cfg["tab"]["user_prop"]." + $sql = "INSERT INTO " . $cfg["tab"]["user_prop"] . " SET value = '" . Contenido_Security::escapeDB($value, $this->db) . "', user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "', type = '" . Contenido_Security::escapeDB($type, $this->db) . "', name = '" . Contenido_Security::escapeDB($name, $this->db) . "', - iduserprop = " .$this->db->nextid($cfg["tab"]["user_prop"]); + iduserprop = " . $this->db->nextid($cfg["tab"]["user_prop"]); $this->db->query($sql); } } @@ -248,17 +226,17 @@ class cApiUser extends Item * @param string type Specifies the type (class, category etc) for the property to retrieve * @param string name Specifies the name of the property to retrieve */ - public function deleteUserProperty($type, $name) - { + public function deleteUserProperty($type, $name) { global $cfg; // Check if such an entry already exists - $sql = "DELETE FROM ".$cfg["tab"]["user_prop"]." - WHERE user_id = '".Contenido_Security::escapeDB($this->values['user_id'], $this->db)."' AND + $sql = "DELETE FROM " . $cfg["tab"]["user_prop"] . " + WHERE user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "' AND type = '" . Contenido_Security::escapeDB($type, $this->db) . "' AND name = '" . Contenido_Security::escapeDB($name, $this->db) . "'"; $this->db->query($sql); } + } ?> \ No newline at end of file