remove deprecated constructors
Dieser Commit ist enthalten in:
Ursprung
ef7df8a507
Commit
f9d232c10a
17 geänderte Dateien mit 176 neuen und 471 gelöschten Zeilen
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.area.php
|
||||
|
@ -18,41 +19,30 @@
|
|||
*
|
||||
* $Id: class.area.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiAreaCollection extends ItemCollection {
|
||||
|
||||
class cApiAreaCollection extends ItemCollection
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
global $cfg;
|
||||
parent::__construct($cfg['tab']['area'], 'idarea');
|
||||
$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
|
||||
* @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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.article.php
|
||||
|
@ -18,7 +19,6 @@
|
|||
*
|
||||
* $Id: class.article.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
@ -26,10 +26,9 @@ if (!defined('CON_FRAMEWORK')) {
|
|||
|
||||
cInclude("includes", "functions.str.php");
|
||||
|
||||
class cApiArticleCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
class cApiArticleCollection extends ItemCollection {
|
||||
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["art"], "idart");
|
||||
$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
|
||||
* @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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -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;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.category.php
|
||||
|
@ -18,16 +19,13 @@
|
|||
*
|
||||
* $Id: class.category.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiCategoryCollection extends ItemCollection {
|
||||
|
||||
class cApiCategoryCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["cat"], "idcat");
|
||||
$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
|
||||
* @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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.categoryarticle.php
|
||||
|
@ -18,16 +19,13 @@
|
|||
*
|
||||
* $Id: class.categoryarticle.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiCategoryArticleCollection extends ItemCollection {
|
||||
|
||||
class cApiCategoryArticleCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["cat_art"], "idcatart");
|
||||
$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
|
||||
* @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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.categorylanguage.php
|
||||
|
@ -18,16 +19,13 @@
|
|||
*
|
||||
* $Id: class.categorylanguage.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiCategoryLanguageCollection extends ItemCollection {
|
||||
|
||||
class cApiCategoryLanguageCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["cat_lang"], "idcatlang");
|
||||
$this->_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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.categorytree.php
|
||||
|
@ -18,16 +19,13 @@
|
|||
*
|
||||
* $Id: class.categorytree.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiCategoryTreeCollection extends ItemCollection {
|
||||
|
||||
class cApiCategoryTreeCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["cat_tree"], "idtree");
|
||||
$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
|
||||
* @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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.clients.php
|
||||
|
@ -18,39 +19,28 @@
|
|||
*
|
||||
* $Id: class.client.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiClientCollection extends ItemCollection {
|
||||
|
||||
class cApiClientCollection extends ItemCollection
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
global $cfg;
|
||||
parent::__construct($cfg['tab']['clients'], 'idclient');
|
||||
$this->_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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.container.php
|
||||
|
@ -18,16 +19,13 @@
|
|||
*
|
||||
* $Id: class.container.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiContainerCollection extends ItemCollection {
|
||||
|
||||
class cApiContainerCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["container"], "idcontainer");
|
||||
$this->_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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.containerconfig.php
|
||||
|
@ -18,16 +19,13 @@
|
|||
*
|
||||
* $Id: class.containerconfig.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiContainerConfigurationCollection extends ItemCollection {
|
||||
|
||||
class cApiContainerConfigurationCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["container_conf"], "idcontainerc");
|
||||
$this->_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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.file.php
|
||||
|
@ -18,33 +19,22 @@
|
|||
*
|
||||
* $Id: class.file.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiFileCollection extends ItemCollection {
|
||||
|
||||
class cApiFileCollection extends ItemCollection
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
global $cfg;
|
||||
parent::__construct($cfg['tab']['files'], 'idfile');
|
||||
$this->_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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.framfile.php
|
||||
|
@ -18,33 +19,22 @@
|
|||
*
|
||||
* $Id: class.framefile.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiFrameFileCollection extends ItemCollection {
|
||||
|
||||
class cApiFrameFileCollection extends ItemCollection
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
global $cfg;
|
||||
parent::__construct($cfg['tab']['framefiles'], 'idframefile');
|
||||
$this->_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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.language.php
|
||||
|
@ -18,14 +19,12 @@
|
|||
*
|
||||
* $Id: class.language.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
|
||||
class cApiLanguageCollection extends ItemCollection {
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
@ -36,22 +35,16 @@ class cApiLanguageCollection extends ItemCollection {
|
|||
$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() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -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();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.template.php
|
||||
|
@ -18,16 +19,13 @@
|
|||
*
|
||||
* $Id: class.template.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiTemplateCollection extends ItemCollection {
|
||||
|
||||
class cApiTemplateCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["tpl"], "idtpl");
|
||||
$this->_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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.templateconfig.php
|
||||
|
@ -18,16 +19,13 @@
|
|||
*
|
||||
* $Id: class.templateconfig.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiTemplateConfigurationCollection extends ItemCollection {
|
||||
|
||||
class cApiTemplateConfigurationCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["tpl_conf"], "idtplcfg");
|
||||
$this->_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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File:
|
||||
* class.user.php
|
||||
|
@ -18,16 +19,13 @@
|
|||
*
|
||||
* $Id: class.user.php 352 2015-09-24 12:12:51Z oldperl $
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
class cApiUserCollection extends ItemCollection {
|
||||
|
||||
class cApiUserCollection extends ItemCollection
|
||||
{
|
||||
public function __construct($select = false)
|
||||
{
|
||||
public function __construct($select = false) {
|
||||
global $cfg;
|
||||
parent::__construct($cfg["tab"]["phplib_auth_user_md5"], "user_id");
|
||||
$this->_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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Laden …
In neuem Issue referenzieren