예제 #1
0
 public static function selectByItemId($intId)
 {
     global $_CONF;
     parent::$__object = "StorageData";
     parent::$__table = "pcms_storage_data";
     $strSql = sprintf("SELECT * FROM " . parent::$__table . " WHERE itemId = '%s'", $intId);
     return parent::select($strSql);
 }
예제 #2
0
 public static function selectSorted()
 {
     global $_CONF;
     parent::$__object = "Feed";
     parent::$__table = "pcms_feed";
     $strSql = sprintf("SELECT * FROM " . parent::$__table . " WHERE accountId = '%s' ORDER BY name", $_CONF['app']['account']->getId());
     return parent::select($strSql);
 }
예제 #3
0
 public static function select($strSql = "")
 {
     global $_CONF;
     parent::$__object = "ContentLanguage";
     parent::$__table = "pcms_language";
     if (empty($strSql)) {
         $strSql = sprintf("SELECT * FROM " . parent::$__table . " WHERE accountId = '%s' ORDER BY sort", $_CONF['app']['account']->getId());
     }
     return parent::select($strSql);
 }
예제 #4
0
 public function save($blnSaveModifiedDate = true)
 {
     parent::$__object = "Template";
     parent::$__table = "pcms_template";
     $intId = $this->getId();
     $blnReturn = parent::save($blnSaveModifiedDate);
     if (class_exists("AuditLog")) {
         AuditLog::addLog(AUDIT_TYPE_TEMPLATE, $this->getId(), $this->getName(), empty($intId) ? "create" : "edit");
     }
     return $blnReturn;
 }
예제 #5
0
 public static function selectByAlias($strAlias)
 {
     global $_CONF;
     parent::$__object = "Alias";
     parent::$__table = "pcms_alias";
     $objReturn = NULL;
     if (!empty($strAlias)) {
         $strSql = sprintf("SELECT * FROM " . parent::$__table . " WHERE accountId = '%s' AND alias = %s ORDER BY sort", $_CONF['app']['account']->getId(), parent::quote($strAlias));
     }
     $objReturn = parent::select($strSql);
     return $objReturn;
 }
예제 #6
0
 public function getItems($intTypeId = STORAGE_TYPE_ALL)
 {
     global $_CONF;
     parent::$__object = "StorageItem";
     parent::$__table = "pcms_storage_item";
     $strSql = sprintf("SELECT * FROM " . parent::$__table . " WHERE parentId = '%s' AND typeId IN (%s) AND accountId = '%s' ORDER BY sort", $this->getId(), $intTypeId, $_CONF['app']['account']->getId());
     return parent::select($strSql);
 }
예제 #7
0
 public function save($blnSaveModifiedDate = true, $blnCreateForced = true)
 {
     parent::$__object = "Element";
     parent::$__table = "pcms_element";
     $intId = $this->getId();
     $blnReturn = parent::save($blnSaveModifiedDate);
     if (class_exists("AuditLog")) {
         AuditLog::addLog(AUDIT_TYPE_ELEMENT, $this->getId(), $this->getName(), empty($intId) ? "create" : "edit", $this->getActive() ? "active" : "inactive");
     }
     //*** Save permissions.
     if (is_object($this->objPermissions)) {
         $this->clearPermissions();
         $this->objPermissions->setElementId($this->id);
         $this->objPermissions->save();
     }
     //*** Create forced children.
     if (empty($intId) && $blnCreateForced) {
         $this->createForcedElements();
     }
     return $blnReturn;
 }