remove deprecated constructors

Dieser Commit ist enthalten in:
oldperl 2017-01-12 23:36:25 +00:00
Ursprung ef7df8a507
Commit f9d232c10a
17 geänderte Dateien mit 176 neuen und 471 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.area.php * class.area.php
@ -18,41 +19,30 @@
* *
* $Id: class.area.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.area.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiAreaCollection extends ItemCollection {
class cApiAreaCollection extends ItemCollection
{
/** /**
* Constructor * Constructor
*/ */
public function __construct() public function __construct() {
{
global $cfg; global $cfg;
parent::__construct($cfg['tab']['area'], 'idarea'); parent::__construct($cfg['tab']['area'], 'idarea');
$this->_setItemClass("cApiArea"); $this->_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 * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg['tab']['area'], 'idarea'); parent::__construct($cfg['tab']['area'], 'idarea');
$this->setFilters(array("addslashes"), array("stripslashes")); $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 create($name, $parentid = 0, $relevant = 1, $online = 1) {
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)
{
$item = parent::createNewItem(); $item = parent::createNewItem();
$item->set("name", $name); $item->set("name", $name);
@ -82,11 +64,11 @@ class cApiArea extends Item
return ($item); return ($item);
} }
public function createAction($area, $name, $code, $location, $relevant) public function createAction($area, $name, $code, $location, $relevant) {
{
$ac = new cApiActionCollection(); $ac = new cApiActionCollection();
$a = $ac->create($area, $name, $code, $location, $relevant); $a = $ac->create($area, $name, $code, $location, $relevant);
} }
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.article.php * class.article.php
@ -18,7 +19,6 @@
* *
* $Id: class.article.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.article.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -26,10 +26,9 @@ if (!defined('CON_FRAMEWORK')) {
cInclude("includes", "functions.str.php"); cInclude("includes", "functions.str.php");
class cApiArticleCollection extends ItemCollection class cApiArticleCollection extends ItemCollection {
{
public function __construct($select = false) public function __construct($select = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["art"], "idart"); parent::__construct($cfg["tab"]["art"], "idart");
$this->_setItemClass("cApiArticle"); $this->_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 * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["art"], "idart"); parent::__construct($cfg["tab"]["art"], "idart");
$this->setFilters(array(), array()); $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);
}
} }
?> ?>

Datei anzeigen

@ -37,13 +37,6 @@ class cApiArticleLanguageCollection extends ItemCollection {
} }
} }
/** @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) { public function getIdArtLang($iIdart, $iIdlang) {
$this->setWhere('idart', Contenido_Security::toInteger($iIdart)); $this->setWhere('idart', Contenido_Security::toInteger($iIdart));
$this->setWhere('idlang', Contenido_Security::toInteger($iIdlang)); $this->setWhere('idlang', Contenido_Security::toInteger($iIdlang));
@ -71,13 +64,6 @@ class cApiArticleLanguage extends Item
} }
} }
/** @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) { public function loadByArticleAndLanguageId($idart, $idlang) {
$result = true; $result = true;
if (!$this->isLoaded()) { if (!$this->isLoaded()) {

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.category.php * class.category.php
@ -18,16 +19,13 @@
* *
* $Id: class.category.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.category.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiCategoryCollection extends ItemCollection {
class cApiCategoryCollection extends ItemCollection public function __construct($select = false) {
{
public function __construct($select = false)
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["cat"], "idcat"); parent::__construct($cfg["tab"]["cat"], "idcat");
$this->_setItemClass("cApiCategory"); $this->_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 * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["cat"], "idcat"); parent::__construct($cfg["tab"]["cat"], "idcat");
$this->setFilters(array(), array()); $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);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.categoryarticle.php * class.categoryarticle.php
@ -18,16 +19,13 @@
* *
* $Id: class.categoryarticle.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.categoryarticle.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiCategoryArticleCollection extends ItemCollection {
class cApiCategoryArticleCollection extends ItemCollection public function __construct($select = false) {
{
public function __construct($select = false)
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["cat_art"], "idcatart"); parent::__construct($cfg["tab"]["cat_art"], "idcatart");
$this->_setItemClass("cApiCategoryArticle"); $this->_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 * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["cat_art"], "idcatart"); parent::__construct($cfg["tab"]["cat_art"], "idcatart");
$this->setFilters(array(), array()); $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);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.categorylanguage.php * class.categorylanguage.php
@ -18,16 +19,13 @@
* *
* $Id: class.categorylanguage.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.categorylanguage.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiCategoryLanguageCollection extends ItemCollection {
class cApiCategoryLanguageCollection extends ItemCollection public function __construct($select = false) {
{
public function __construct($select = false)
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["cat_lang"], "idcatlang"); parent::__construct($cfg["tab"]["cat_lang"], "idcatlang");
$this->_setItemClass("cApiCategoryLanguage"); $this->_setItemClass("cApiCategoryLanguage");
@ -36,24 +34,15 @@ class cApiCategoryLanguageCollection extends ItemCollection
$this->select($select); $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 * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["cat_lang"], "idcatlang"); parent::__construct($cfg["tab"]["cat_lang"], "idcatlang");
$this->setFilters(array(), array()); $this->setFilters(array(), array());
@ -62,15 +51,7 @@ class cApiCategoryLanguage extends Item
} }
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ public function setField($field, $value, $bSafe = true) {
public function cApiCategoryLanguage($mId = false)
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId);
}
public function setField($field, $value)
{
switch ($field) { switch ($field) {
case "name": case "name":
$this->setField("urlname", $value); $this->setField("urlname", $value);
@ -83,8 +64,7 @@ class cApiCategoryLanguage extends Item
parent::setField($field, $value); parent::setField($field, $value);
} }
public function assignTemplate($idtpl) public function assignTemplate($idtpl) {
{
$c_tplcfg = new cApiTemplateConfigurationCollection(); $c_tplcfg = new cApiTemplateConfigurationCollection();
if ($this->get("idtplcfg") != 0) { if ($this->get("idtplcfg") != 0) {
@ -100,17 +80,16 @@ class cApiCategoryLanguage extends Item
return ($tplcfg); return ($tplcfg);
} }
public function getTemplate() public function getTemplate() {
{
$c_tplcfg = new cApiTemplateConfiguration($this->get("idtplcfg")); $c_tplcfg = new cApiTemplateConfiguration($this->get("idtplcfg"));
return ($c_tplcfg->get("idtpl")); return ($c_tplcfg->get("idtpl"));
} }
public function hasStartArticle() public function hasStartArticle() {
{
cInclude("includes", "functions.str.php"); cInclude("includes", "functions.str.php");
return strHasStartArticle($this->get("idcat"), $this->get("idlang")); return strHasStartArticle($this->get("idcat"), $this->get("idlang"));
} }
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.categorytree.php * class.categorytree.php
@ -18,16 +19,13 @@
* *
* $Id: class.categorytree.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.categorytree.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiCategoryTreeCollection extends ItemCollection {
class cApiCategoryTreeCollection extends ItemCollection public function __construct($select = false) {
{
public function __construct($select = false)
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["cat_tree"], "idtree"); parent::__construct($cfg["tab"]["cat_tree"], "idtree");
$this->_setJoinPartner("cApiCategoryCollection"); $this->_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 * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["cat_tree"], "idtree"); parent::__construct($cfg["tab"]["cat_tree"], "idtree");
$this->setFilters(array(), array()); $this->setFilters(array(), array());
@ -61,13 +51,5 @@ class cApiTree extends Item
$this->loadByPrimaryKey($mId); $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);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.clients.php * class.clients.php
@ -18,39 +19,28 @@
* *
* $Id: class.client.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.client.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiClientCollection extends ItemCollection {
class cApiClientCollection extends ItemCollection
{
/** /**
* Constructor * Constructor
*/ */
public function __construct() public function __construct() {
{
global $cfg; global $cfg;
parent::__construct($cfg['tab']['clients'], 'idclient'); parent::__construct($cfg['tab']['clients'], 'idclient');
$this->_setItemClass("cApiClient"); $this->_setItemClass("cApiClient");
$this->_setJoinPartner("cApiClientLanguageCollection"); $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 * Returns all clients available in the system
* *
* @return array Array with id and name entries * @return array Array with id and name entries
*/ */
public function getAvailableClients() public function getAvailableClients() {
{
$aClients = array(); $aClients = array();
$this->select(); $this->select();
@ -67,14 +57,13 @@ class cApiClientCollection extends ItemCollection
* *
* @return array Array with id and name entries * @return array Array with id and name entries
*/ */
public function getAccessibleClients() public function getAccessibleClients() {
{
global $perm; global $perm;
$aClients = array(); $aClients = array();
$this->select(); $this->select();
while ($oItem = $this->next()) { while ($oItem = $this->next()) {
if ($perm->have_perm_client("client[".$oItem->get('idclient')."]") || if ($perm->have_perm_client("client[" . $oItem->get('idclient') . "]") ||
$perm->have_perm_client("admin[".$oItem->get('idclient')."]") || $perm->have_perm_client("admin[" . $oItem->get('idclient') . "]") ||
$perm->have_perm_client()) { $perm->have_perm_client()) {
$aClients[$oItem->get('idclient')] = array('name' => $oItem->get('name')); $aClients[$oItem->get('idclient')] = array('name' => $oItem->get('name'));
} }
@ -88,8 +77,7 @@ class cApiClientCollection extends ItemCollection
* @param int $iIdClient * @param int $iIdClient
* @return string Clientname if found, or empty string if not. * @return string Clientname if found, or empty string if not.
*/ */
public function getClientname($iIdClient) public function getClientname($iIdClient) {
{
$this->select("idclient='" . (int) $iIdClient . "'"); $this->select("idclient='" . (int) $iIdClient . "'");
if ($oItem = $this->next()) { if ($oItem = $this->next()) {
return $oItem->get('name'); return $oItem->get('name');
@ -104,8 +92,7 @@ class cApiClientCollection extends ItemCollection
* @param int $iIdClient * @param int $iIdClient
* @return bool true if the client has a language * @return bool true if the client has a language
*/ */
public function hasLanguageAssigned($iIdClient) public function hasLanguageAssigned($iIdClient) {
{
global $cfg; global $cfg;
$db = new DB_ConLite(); $db = new DB_ConLite();
$sql = 'SELECT idlang FROM ' . $cfg['tab']['clients_lang'] . ' WHERE idclient = "' . (int) $iIdClient . '"'; $sql = 'SELECT idlang FROM ' . $cfg['tab']['clients_lang'] . ' WHERE idclient = "' . (int) $iIdClient . '"';
@ -116,8 +103,8 @@ class cApiClientCollection extends ItemCollection
return false; return false;
} }
} }
}
}
/** /**
* Class cApiClient * Class cApiClient
@ -125,8 +112,8 @@ class cApiClientCollection extends ItemCollection
* @version 1.01 * @version 1.01
* @copyright four for business 2004 * @copyright four for business 2004
*/ */
class cApiClient extends Item class cApiClient extends Item {
{
public $idclient; public $idclient;
/** /**
@ -139,8 +126,7 @@ class cApiClient extends Item
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg['tab']['clients'], 'idclient'); parent::__construct($cfg['tab']['clients'], 'idclient');
if ($mId !== false) { 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. * Static accessor to the singleton instance.
* *
@ -162,8 +141,7 @@ class cApiClient extends Item
* @param int $iClient * @param int $iClient
* @return cApiClient Reference to the singleton instance. * @return cApiClient Reference to the singleton instance.
*/ */
public static function getInstance($iClient = false) public static function getInstance($iClient = false) {
{
static $oCurrentInstance = array(); static $oCurrentInstance = array();
if (!$iClient) { if (!$iClient) {
@ -184,8 +162,7 @@ class cApiClient extends Item
* @param int $iIdKey * @param int $iIdKey
* @return bool * @return bool
*/ */
public function loadByPrimaryKey($iIdKey) public function loadByPrimaryKey($iIdKey) {
{
if (parent::loadByPrimaryKey($iIdKey) == true) { if (parent::loadByPrimaryKey($iIdKey) == true) {
$this->idclient = $iIdKey; $this->idclient = $iIdKey;
return true; return true;
@ -201,8 +178,7 @@ class cApiClient extends Item
* @param mixed $mValue Value * @param mixed $mValue Value
* @param mixed $mIdproperty * @param mixed $mIdproperty
*/ */
public function setProperty($mType, $mName, $mValue, $mIdproperty = 0) public function setProperty($mType, $mName, $mValue, $mIdproperty = 0) {
{
$oPropertyColl = $this->_getPropertiesCollectionInstance(); $oPropertyColl = $this->_getPropertiesCollectionInstance();
$oPropertyColl->setValue('clientsetting', $this->idclient, $mType, $mName, $mValue, $mIdproperty); $oPropertyColl->setValue('clientsetting', $this->idclient, $mType, $mName, $mValue, $mIdproperty);
} }
@ -214,8 +190,7 @@ class cApiClient extends Item
* @param mixed $mName Entry name * @param mixed $mName Entry name
* @return mixed Value * @return mixed Value
*/ */
public function getProperty($mType, $mName) public function getProperty($mType, $mName) {
{
$oPropertyColl = $this->_getPropertiesCollectionInstance(); $oPropertyColl = $this->_getPropertiesCollectionInstance();
return $oPropertyColl->getValue('clientsetting', $this->idclient, $mType, $mName); return $oPropertyColl->getValue('clientsetting', $this->idclient, $mType, $mName);
} }
@ -226,8 +201,7 @@ class cApiClient extends Item
* @param int $iIdProp Id of property * @param int $iIdProp Id of property
* @return void * @return void
*/ */
public function deletePropertyById($iIdProp) public function deletePropertyById($iIdProp) {
{
$oPropertyColl = $this->_getPropertiesCollectionInstance(); $oPropertyColl = $this->_getPropertiesCollectionInstance();
$oPropertyColl->delete($iIdProp); $oPropertyColl->delete($iIdProp);
} }
@ -238,8 +212,7 @@ class cApiClient extends Item
* @param mixed $mType Type of the data to get * @param mixed $mType Type of the data to get
* @return array Assoziative array * @return array Assoziative array
*/ */
public function getPropertiesByType($mType) public function getPropertiesByType($mType) {
{
$oPropertyColl = $this->_getPropertiesCollectionInstance(); $oPropertyColl = $this->_getPropertiesCollectionInstance();
return $oPropertyColl->getValuesByType('clientsetting', $this->idclient, $mType); return $oPropertyColl->getValuesByType('clientsetting', $this->idclient, $mType);
} }
@ -251,10 +224,9 @@ class cApiClient extends Item
* @return array|false Assoziative array * @return array|false Assoziative array
* @todo return value should be the same as getPropertiesByType(), e. g. an empty array instead false * @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 = $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) { if ($oPropertyColl->count() > 0) {
$aArray = array(); $aArray = array();
@ -276,8 +248,7 @@ class cApiClient extends Item
* *
* @return bool * @return bool
*/ */
public function hasLanguages() public function hasLanguages() {
{
$cApiClientLanguageCollection = new cApiClientLanguageCollection(); $cApiClientLanguageCollection = new cApiClientLanguageCollection();
$cApiClientLanguageCollection->setWhere("idclient", $this->get("idclient")); $cApiClientLanguageCollection->setWhere("idclient", $this->get("idclient"));
$cApiClientLanguageCollection->query(); $cApiClientLanguageCollection->query();
@ -294,8 +265,7 @@ class cApiClient extends Item
* *
* @return PropertyCollection * @return PropertyCollection
*/ */
protected function _getPropertiesCollectionInstance() protected function _getPropertiesCollectionInstance() {
{
// Runtime on-demand allocation of the properties object // Runtime on-demand allocation of the properties object
if (!is_object($this->_oPropertyCollection)) { if (!is_object($this->_oPropertyCollection)) {
$this->_oPropertyCollection = new PropertyCollection(); $this->_oPropertyCollection = new PropertyCollection();
@ -303,6 +273,6 @@ class cApiClient extends Item
} }
return $this->_oPropertyCollection; return $this->_oPropertyCollection;
} }
}
}
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.container.php * class.container.php
@ -18,16 +19,13 @@
* *
* $Id: class.container.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.container.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiContainerCollection extends ItemCollection {
class cApiContainerCollection extends ItemCollection public function __construct($select = false) {
{
public function __construct($select = false)
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["container"], "idcontainer"); parent::__construct($cfg["tab"]["container"], "idcontainer");
$this->_setItemClass("cApiContainer"); $this->_setItemClass("cApiContainer");
@ -36,23 +34,14 @@ class cApiContainerCollection extends ItemCollection
} }
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ public function clearAssignments($idtpl) {
public function cApiContainerCollection($select = false)
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($select = false);
}
public function clearAssignments($idtpl)
{
$this->select("idtpl = '$idtpl'"); $this->select("idtpl = '$idtpl'");
while ($item = $this->next()) { while ($item = $this->next()) {
$this->delete($item->get("idcontainer")); $this->delete($item->get("idcontainer"));
} }
} }
public function assignModul($idtpl, $number, $module) public function assignModul($idtpl, $number, $module) {
{
$this->select("idtpl = '$idtpl' AND number = '$number'"); $this->select("idtpl = '$idtpl' AND number = '$number'");
if ($item = $this->next()) { if ($item = $this->next()) {
$item->set("module", $module); $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 = parent::createNewItem();
$item->set("idtpl", $idtpl); $item->set("idtpl", $idtpl);
$item->set("number", $number); $item->set("number", $number);
$item->set("module", $module); $item->set("module", $module);
$item->store(); $item->store();
} }
} }
class cApiContainer extends Item {
class cApiContainer extends Item
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["container"], "idcontainer"); parent::__construct($cfg["tab"]["container"], "idcontainer");
$this->setFilters(array(), array()); $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);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.containerconfig.php * class.containerconfig.php
@ -18,16 +19,13 @@
* *
* $Id: class.containerconfig.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.containerconfig.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiContainerConfigurationCollection extends ItemCollection {
class cApiContainerConfigurationCollection extends ItemCollection public function __construct($select = false) {
{
public function __construct($select = false)
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["container_conf"], "idcontainerc"); parent::__construct($cfg["tab"]["container_conf"], "idcontainerc");
$this->_setItemClass("cApiContainerConfiguration"); $this->_setItemClass("cApiContainerConfiguration");
@ -36,32 +34,23 @@ class cApiContainerConfigurationCollection extends ItemCollection
} }
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ public function create($idtplcfg, $number, $container) {
public function cApiContainerConfigurationCollection($select = false)
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($select = false);
}
public function create($idtplcfg, $number, $container)
{
$item = parent::createNewItem(); $item = parent::createNewItem();
$item->set("idtplcfg", $idtplcfg); $item->set("idtplcfg", $idtplcfg);
$item->set("number", $number); $item->set("number", $number);
$item->set("container", $container); $item->set("container", $container);
$item->store(); $item->store();
} }
} }
class cApiContainerConfiguration extends Item {
class cApiContainerConfiguration extends Item
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["container_conf"], "idcontainerc"); parent::__construct($cfg["tab"]["container_conf"], "idcontainerc");
$this->setFilters(array(), array()); $this->setFilters(array(), array());
@ -69,13 +58,5 @@ class cApiContainerConfiguration extends Item
$this->loadByPrimaryKey($mId); $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);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.file.php * class.file.php
@ -18,33 +19,22 @@
* *
* $Id: class.file.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.file.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiFileCollection extends ItemCollection {
class cApiFileCollection extends ItemCollection
{
/** /**
* Constructor * Constructor
*/ */
public function __construct() public function __construct() {
{
global $cfg; global $cfg;
parent::__construct($cfg['tab']['files'], 'idfile'); parent::__construct($cfg['tab']['files'], 'idfile');
$this->_setItemClass("cApiFile"); $this->_setItemClass("cApiFile");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ public function create($area, $filename, $filetype = "main") {
public function cApiFileCollection()
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct();
}
public function create($area, $filename, $filetype = "main")
{
$item = parent::createNewItem(); $item = parent::createNewItem();
if (is_string($area)) { if (is_string($area)) {
@ -72,17 +62,16 @@ class cApiFileCollection extends ItemCollection
return ($item); return ($item);
} }
} }
class cApiFile extends Item {
class cApiFile extends Item
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["files"], "idfile"); parent::__construct($cfg["tab"]["files"], "idfile");
$this->setFilters(array("addslashes"), array("stripslashes")); $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);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.framfile.php * class.framfile.php
@ -18,33 +19,22 @@
* *
* $Id: class.framefile.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.framefile.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiFrameFileCollection extends ItemCollection {
class cApiFrameFileCollection extends ItemCollection
{
/** /**
* Constructor * Constructor
*/ */
public function __construct() public function __construct() {
{
global $cfg; global $cfg;
parent::__construct($cfg['tab']['framefiles'], 'idframefile'); parent::__construct($cfg['tab']['framefiles'], 'idframefile');
$this->_setItemClass("cApiFrameFile"); $this->_setItemClass("cApiFrameFile");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ public function create($area, $idframe, $idfile) {
public function cApiFrameFileCollection()
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct();
}
public function create($area, $idframe, $idfile)
{
$item = parent::createNewItem(); $item = parent::createNewItem();
if (is_string($area)) { if (is_string($area)) {
@ -67,17 +57,16 @@ class cApiFrameFileCollection extends ItemCollection
return ($item); return ($item);
} }
} }
class cApiFrameFile extends Item {
class cApiFrameFile extends Item
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["framefiles"], "idframefile"); parent::__construct($cfg["tab"]["framefiles"], "idframefile");
$this->setFilters(array("addslashes"), array("stripslashes")); $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);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.language.php * class.language.php
@ -18,12 +19,10 @@
* *
* $Id: class.language.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.language.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiLanguageCollection extends ItemCollection { class cApiLanguageCollection extends ItemCollection {
/** /**
@ -36,12 +35,6 @@ class cApiLanguageCollection extends ItemCollection {
$this->_setJoinPartner("cApiClientLanguageCollection"); $this->_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() { public function nextAccessible() {
global $perm, $client, $cfg, $lang; global $perm, $client, $cfg, $lang;
@ -51,7 +44,7 @@ class cApiLanguageCollection extends ItemCollection {
$lang = Contenido_Security::toInteger($lang); $lang = Contenido_Security::toInteger($lang);
$client = Contenido_Security::toInteger($client); $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); $db->query($sql);
if ($db->next_record()) { if ($db->next_record()) {
@ -61,8 +54,8 @@ class cApiLanguageCollection extends ItemCollection {
} }
if ($item) { if ($item) {
if ($perm->have_perm_client("lang[".$item->get("idlang")."]") || if ($perm->have_perm_client("lang[" . $item->get("idlang") . "]") ||
$perm->have_perm_client("admin[".$client."]") || $perm->have_perm_client("admin[" . $client . "]") ||
$perm->have_perm_client()) { $perm->have_perm_client()) {
// Do nothing for now // Do nothing for now
} else { } else {
@ -82,20 +75,20 @@ class cApiLanguageCollection extends ItemCollection {
* @param boolean $bWithValues * @param boolean $bWithValues
* @return array * @return array
*/ */
public function getClientLanguages($iClient, $bWithValues=false) { public function getClientLanguages($iClient, $bWithValues = false) {
$aList = array(); $aList = array();
$oClientLangCol = new cApiClientLanguageCollection(); $oClientLangCol = new cApiClientLanguageCollection();
$oClientLangCol->setWhere("idclient", $iClient); $oClientLangCol->setWhere("idclient", $iClient);
$oClientLangCol->query(); $oClientLangCol->query();
while($oItem = $oClientLangCol->next()) { while ($oItem = $oClientLangCol->next()) {
$mTmpValues = ''; $mTmpValues = '';
if($bWithValues) { if ($bWithValues) {
$oLanguage = new cApiLanguage($oItem->get("idlang")); $oLanguage = new cApiLanguage($oItem->get("idlang"));
$mTmpValues = array( $mTmpValues = array(
"idlang" => $oItem->get("idlang"), "idlang" => $oItem->get("idlang"),
"name" => $oLanguage->get("name"), "name" => $oLanguage->get("name"),
"active" => ($oLanguage->get("active"))?true:false, "active" => ($oLanguage->get("active")) ? true : false,
"encoding" => $oLanguage->get("encoding") "encoding" => $oLanguage->get("encoding")
); );
unset($oLanguage); unset($oLanguage);
@ -107,8 +100,8 @@ class cApiLanguageCollection extends ItemCollection {
unset($oClientLangCol, $oItem); unset($oClientLangCol, $oItem);
return $aList; return $aList;
} }
}
}
class cApiLanguage extends Item { class cApiLanguage extends Item {
@ -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);
}
} }
?> ?>

Datei anzeigen

@ -33,12 +33,6 @@ class cApiLayoutCollection extends ItemCollection {
$this->_setItemClass("cApiLayout"); $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) { public function create($title) {
global $client; global $client;
$item = parent::createNewItem(); $item = parent::createNewItem();

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.template.php * class.template.php
@ -18,16 +19,13 @@
* *
* $Id: class.template.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.template.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiTemplateCollection extends ItemCollection {
class cApiTemplateCollection extends ItemCollection public function __construct($select = false) {
{
public function __construct($select = false)
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["tpl"], "idtpl"); parent::__construct($cfg["tab"]["tpl"], "idtpl");
$this->_setItemClass("cApiTemplate"); $this->_setItemClass("cApiTemplate");
@ -36,35 +34,26 @@ class cApiTemplateCollection extends ItemCollection
} }
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ public function setDefaultTemplate($idtpl) {
public function cApiTemplateCollection($select = false)
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($select);
}
public function setDefaultTemplate($idtpl)
{
global $cfg, $client; global $cfg, $client;
$db = new DB_ConLite(); $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); $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); $db->query($sql);
} }
} }
class cApiTemplate extends Item {
class cApiTemplate extends Item
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["tpl"], "idtpl"); parent::__construct($cfg["tab"]["tpl"], "idtpl");
$this->setFilters(array(), array()); $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);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.templateconfig.php * class.templateconfig.php
@ -18,16 +19,13 @@
* *
* $Id: class.templateconfig.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.templateconfig.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiTemplateConfigurationCollection extends ItemCollection {
class cApiTemplateConfigurationCollection extends ItemCollection public function __construct($select = false) {
{
public function __construct($select = false)
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["tpl_conf"], "idtplcfg"); parent::__construct($cfg["tab"]["tpl_conf"], "idtplcfg");
$this->_setItemClass("cApiTemplateConfiguration"); $this->_setItemClass("cApiTemplateConfiguration");
@ -36,29 +34,20 @@ class cApiTemplateConfigurationCollection extends ItemCollection
} }
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ public function delete($idtplcfg) {
public function FrontendPermission($select = false)
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($select);
}
public function delete($idtplcfg)
{
$result = parent::delete($idtplcfg); $result = parent::delete($idtplcfg);
$oContainerConfCollection = new cApiContainerConfigurationCollection ("idtplcfg = '$idtplcfg'"); $oContainerConfCollection = new cApiContainerConfigurationCollection("idtplcfg = '$idtplcfg'");
$aDelContainerConfIds = array(); $aDelContainerConfIds = array();
while ($oContainerConf = $oContainerConfCollection->next()) { while ($oContainerConf = $oContainerConfCollection->next()) {
array_push($aDelContainerConfIds, $oContainerConf->get('idcontainerc')); array_push($aDelContainerConfIds, $oContainerConf->get('idcontainerc'));
} }
foreach($aDelContainerConfIds as $iDelContainerConfId) { foreach ($aDelContainerConfIds as $iDelContainerConfId) {
$oContainerConfCollection->delete($iDelContainerConfId); $oContainerConfCollection->delete($iDelContainerConfId);
} }
} }
public function create($idtpl) public function create($idtpl) {
{
global $auth; global $auth;
$item = parent::createNewItem(); $item = parent::createNewItem();
@ -77,7 +66,7 @@ class cApiTemplateConfigurationCollection extends ItemCollection
if ($template = $templateCollection->next()) { if ($template = $templateCollection->next()) {
$idTplcfgStandard = $template->get("idtplcfg"); $idTplcfgStandard = $template->get("idtplcfg");
if ($idTplcfgStandard > 0) { if ($idTplcfgStandard > 0) {
$oContainerConfCollection = new cApiContainerConfigurationCollection ("idtplcfg = '$idTplcfgStandard'"); $oContainerConfCollection = new cApiContainerConfigurationCollection("idtplcfg = '$idTplcfgStandard'");
$aStandardconfig = array(); $aStandardconfig = array();
while ($oContainerConf = $oContainerConfCollection->next()) { while ($oContainerConf = $oContainerConfCollection->next()) {
$aStandardconfig[$oContainerConf->get('number')] = $oContainerConf->get('container'); $aStandardconfig[$oContainerConf->get('number')] = $oContainerConf->get('container');
@ -91,17 +80,16 @@ class cApiTemplateConfigurationCollection extends ItemCollection
return ($item); return ($item);
} }
} }
class cApiTemplateConfiguration extends Item {
class cApiTemplateConfiguration extends Item
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["tpl_conf"], "idtplcfg"); parent::__construct($cfg["tab"]["tpl_conf"], "idtplcfg");
$this->setFilters(array(), array()); $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);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* File: * File:
* class.user.php * class.user.php
@ -18,16 +19,13 @@
* *
* $Id: class.user.php 352 2015-09-24 12:12:51Z oldperl $ * $Id: class.user.php 352 2015-09-24 12:12:51Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
class cApiUserCollection extends ItemCollection {
class cApiUserCollection extends ItemCollection public function __construct($select = false) {
{
public function __construct($select = false)
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["phplib_auth_user_md5"], "user_id"); parent::__construct($cfg["tab"]["phplib_auth_user_md5"], "user_id");
$this->_setItemClass("cApiUser"); $this->_setItemClass("cApiUser");
@ -36,15 +34,7 @@ class cApiUserCollection extends ItemCollection
} }
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ public function create($username) {
public function cApiUserCollection($select = false)
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($select);
}
public function create($username)
{
$md5user = md5($username); $md5user = md5($username);
$this->resetQuery(); $this->resetQuery();
@ -62,17 +52,16 @@ class cApiUserCollection extends ItemCollection
return ($item); return ($item);
} }
} }
} }
class cApiUser extends Item {
class cApiUser extends Item
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["phplib_auth_user_md5"], "user_id"); parent::__construct($cfg["tab"]["phplib_auth_user_md5"], "user_id");
$this->setFilters(array(), array()); $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 * Stores the modified user object to the database
* @param string type Specifies the type (class, category etc) for the property to retrieve * @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 * @param boolean group Specifies if this function should recursively search in groups
* @return string The value of the retrieved property * @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; global $cfg, $perm;
if (!is_object($perm)) { if (!is_object($perm)) {
@ -110,8 +91,8 @@ class cApiUser extends Item
if (is_array($groups)) { if (is_array($groups)) {
foreach ($groups as $value) { foreach ($groups as $value) {
$sql = "SELECT value FROM " .$cfg["tab"]["group_prop"]." $sql = "SELECT value FROM " . $cfg["tab"]["group_prop"] . "
WHERE group_id = '".$value."' WHERE group_id = '" . $value . "'
AND type = '$type' AND type = '$type'
AND name = '$name'"; AND name = '$name'";
$this->db->query($sql); $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) . "' WHERE user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "'
AND type = '" . Contenido_Security::escapeDB($type, $this->db) . "' AND type = '" . Contenido_Security::escapeDB($type, $this->db) . "'
AND name = '" . Contenido_Security::escapeDB($name, $this->db) . "'"; AND name = '" . Contenido_Security::escapeDB($name, $this->db) . "'";
@ -146,9 +127,8 @@ class cApiUser extends Item
* @param string $sType Specifies the type (class, category etc) for the property to retrieve * @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 * @param bool $bGroup Specifies if this function should recursively search in groups
* @return array The value of the retrieved property * @return array The value of the retrieved property
**/ * */
public function getUserPropertiesByType($sType, $bGroup = false) public function getUserPropertiesByType($sType, $bGroup = false) {
{
global $cfg, $perm; global $cfg, $perm;
if (!is_object($perm)) { if (!is_object($perm)) {
@ -162,9 +142,9 @@ class cApiUser extends Item
if (is_array($aGroups)) { if (is_array($aGroups)) {
foreach ($aGroups as $iID) { foreach ($aGroups as $iID) {
$sSQL = "SELECT name, value FROM " .$cfg["tab"]["group_prop"]." $sSQL = "SELECT name, value FROM " . $cfg["tab"]["group_prop"] . "
WHERE group_id = '" . Contenido_Security::escapeDB($iID, $this->db) . "' 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); $this->db->query($sSQL);
while ($this->db->next_record()) { while ($this->db->next_record()) {
@ -174,9 +154,9 @@ class cApiUser extends Item
} }
} }
$sSQL = "SELECT name, value FROM " .$cfg["tab"]["user_prop"]." $sSQL = "SELECT name, value FROM " . $cfg["tab"]["user_prop"] . "
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($sType, $this->db) . "'"; AND type = '" . Contenido_Security::escapeDB($sType, $this->db) . "'";
$this->db->query($sSQL); $this->db->query($sSQL);
while ($this->db->next_record()) { while ($this->db->next_record()) {
@ -191,12 +171,11 @@ class cApiUser extends Item
* *
* @return array|bool * @return array|bool
*/ */
public function getUserProperties() public function getUserProperties() {
{
global $cfg; global $cfg;
$sql = "SELECT type, name FROM " .$cfg["tab"]["user_prop"]." $sql = "SELECT type, name FROM " . $cfg["tab"]["user_prop"] . "
WHERE user_id = '".Contenido_Security::escapeDB($this->values['user_id'], $this->db)."'"; WHERE user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "'";
$this->db->query($sql); $this->db->query($sql);
if ($this->db->num_rows() == 0) { if ($this->db->num_rows() == 0) {
@ -218,27 +197,26 @@ class cApiUser extends Item
* @param string name Specifies the name of the property to retrieve * @param string name Specifies the name of the property to retrieve
* @param string value Specifies the value to insert * @param string value Specifies the value to insert
*/ */
public function setUserProperty($type, $name, $value) public function setUserProperty($type, $name, $value) {
{
global $cfg; global $cfg;
$value = urlencode($value); $value = urlencode($value);
// Check if such an entry already exists // Check if such an entry already exists
if ($this->getUserProperty($type, $name) !== false) { if ($this->getUserProperty($type, $name) !== false) {
$sql = "UPDATE ".$cfg["tab"]["user_prop"]." $sql = "UPDATE " . $cfg["tab"]["user_prop"] . "
SET value = '$value' 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 type = '" . Contenido_Security::escapeDB($type, $this->db) . "'
AND name = '" . Contenido_Security::escapeDB($name, $this->db) . "'"; AND name = '" . Contenido_Security::escapeDB($name, $this->db) . "'";
$this->db->query($sql); $this->db->query($sql);
} else { } else {
$sql = "INSERT INTO ".$cfg["tab"]["user_prop"]." $sql = "INSERT INTO " . $cfg["tab"]["user_prop"] . "
SET value = '" . Contenido_Security::escapeDB($value, $this->db) . "', SET value = '" . Contenido_Security::escapeDB($value, $this->db) . "',
user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "', user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "',
type = '" . Contenido_Security::escapeDB($type, $this->db) . "', type = '" . Contenido_Security::escapeDB($type, $this->db) . "',
name = '" . Contenido_Security::escapeDB($name, $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); $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 type Specifies the type (class, category etc) for the property to retrieve
* @param string name Specifies the name of 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; global $cfg;
// Check if such an entry already exists // Check if such an entry already exists
$sql = "DELETE FROM ".$cfg["tab"]["user_prop"]." $sql = "DELETE FROM " . $cfg["tab"]["user_prop"] . "
WHERE user_id = '".Contenido_Security::escapeDB($this->values['user_id'], $this->db)."' AND WHERE user_id = '" . Contenido_Security::escapeDB($this->values['user_id'], $this->db) . "' AND
type = '" . Contenido_Security::escapeDB($type, $this->db) . "' AND type = '" . Contenido_Security::escapeDB($type, $this->db) . "' AND
name = '" . Contenido_Security::escapeDB($name, $this->db) . "'"; name = '" . Contenido_Security::escapeDB($name, $this->db) . "'";
$this->db->query($sql); $this->db->query($sql);
} }
} }
?> ?>