コード例 #1
0
ファイル: modules.php プロジェクト: janssit/nickys.janss.be
 /**
  * Get default values for all columns
  *
  * This method is specialized in order to set the default module position 
  * and published state
  * 
  * @return  array
  */
 public function getDefaults()
 {
     $defaults = parent::getDefaults();
     $defaults['position'] = 'left';
     $defaults['published'] = 1;
     $defaults['description'] = '';
     return $defaults;
 }
コード例 #2
0
ファイル: revisions.php プロジェクト: janssit/nickys.janss.be
 /**
  * Insert a new row into the table
  * 
  * Takes care of automatically incrementing the revision number
  *
  * @param Library\DatabaseRowInterface $row
  */
 public function insert(Library\DatabaseRowInterface $row)
 {
     $query = $this->getObject('lib:database.query.select')->where('table', '=', $row->table)->where('row', '=', $row->row)->order('revision', 'desc')->limit(1);
     $latest = $this->select($query, Library\Database::FETCH_ROW);
     if (!$latest->isNew()) {
         $row->revision = $latest->revision + 1;
     }
     return parent::insert($row);
 }
コード例 #3
0
ファイル: revisable.php プロジェクト: janssit/nickys.janss.be
 /**
  * Insert a new revision
  *
  * @param  string  $status  The row status
  * @return void
  */
 protected function _insertRevision()
 {
     $table = $this->getTable();
     // Get the row data
     if ($this->getStatus() == Library\Database::STATUS_UPDATED) {
         $data = $this->getData(true);
     } else {
         $data = $this->getData();
     }
     //Get the row status
     $status = $this->getStatus();
     if ($status == Library\Database::STATUS_LOADED) {
         $status = Library\Database::STATUS_CREATED;
     }
     // Create the new revision
     $revision = $this->_table->getRow();
     $revision->table = $table->getBase();
     $revision->row = $this->id;
     $revision->status = $status;
     $revision->data = (object) $table->filter($data);
     // Set the created_on and created_by information based on the creatable or modifiable data in the row
     if ($this->isCreatable()) {
         if (isset($this->created_by) && !empty($this->created_by)) {
             $revision->created_by = $this->created_by;
         }
         if (isset($this->created_on) && $this->created_on != $table->getDefault('created_on')) {
             $revision->created_on = $this->created_on;
         }
     }
     if ($this->isModifiable()) {
         if (isset($this->modified_by) && !empty($this->modified_by)) {
             $revision->created_by = $this->modified_by;
         }
         if (isset($this->modified_on) && $this->modified_on != $table->getDefault('modified_on')) {
             $revision->created_on = $this->modified_on;
         }
     }
     // Set revision number.
     if ($status == Library\Database::STATUS_UPDATED || $status == Library\Database::STATUS_DELETED) {
         $query = $this->getObject('lib:database.query.select')->where('table = :table')->where('row = :row')->order('revision', 'DESC')->bind(array('table' => $table->getBase(), 'row' => $this->id));
         $revision->revision = $this->_table->select($query, Library\Database::FETCH_ROW)->revision + 1;
     }
     // Store the revision
     return $revision->save();
 }
コード例 #4
0
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'attachments', 'behaviors' => array('creatable', 'modifiable', 'lockable'), 'filters' => array('description' => array('html', 'tidy'))));
     parent::_initialize($config);
 }
コード例 #5
0
 public function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'extensions', 'filters' => array('params' => 'ini')));
     parent::_initialize($config);
 }
コード例 #6
0
ファイル: users.php プロジェクト: janssit/nickys.janss.be
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'users', 'behaviors' => array('modifiable', 'creatable', 'lockable', 'identifiable', 'authenticatable'), 'column_map' => array('role_id' => 'users_role_id', 'group_id' => 'users_group_id')));
     parent::_initialize($config);
 }
コード例 #7
0
ファイル: tags.php プロジェクト: janssit/nickys.janss.be
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'tags', 'behaviors' => array('creatable', 'modifiable', 'lockable', 'sluggable')));
     parent::_initialize($config);
 }
コード例 #8
0
ファイル: contacts.php プロジェクト: janssit/nickys.janss.be
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'contacts', 'behaviors' => array('creatable', 'modifiable', 'lockable', 'orderable' => array('strategy' => 'flat'), 'sluggable' => array('columns' => array('name')), 'com:attachments.database.behavior.attachable'), 'filters' => array('misc' => array('html', 'tidy'), 'params' => 'ini')));
     parent::_initialize($config);
 }
コード例 #9
0
 public function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'categories', 'behaviors' => array('creatable', 'modifiable', 'lockable', 'sluggable', 'cascadable', 'nestable', 'orderable' => array('parent_column' => 'parent_id'), 'com:attachments.database.behavior.attachable')));
     parent::_initialize($config);
 }
コード例 #10
0
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('column_map' => array('group_id' => 'users_group_id', 'user_id' => 'users_user_id')));
     parent::_initialize($config);
 }
コード例 #11
0
ファイル: sessions.php プロジェクト: janssit/nickys.janss.be
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('identity_column' => 'users_session_id'));
     parent::_initialize($config);
 }
コード例 #12
0
ファイル: emails.php プロジェクト: janssit/nickys.janss.be
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'clients_clients'));
     parent::_initialize($config);
 }
コード例 #13
0
ファイル: passwords.php プロジェクト: janssit/nickys.janss.be
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('behaviors' => array('expirable')));
     parent::_initialize($config);
 }
コード例 #14
0
ファイル: pages.php プロジェクト: janssit/nickys.janss.be
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'pages', 'behaviors' => array('creatable', 'lockable', 'sluggable', 'assignable', 'typable', 'com:pages.database.behavior.orderable' => array('strategy' => 'closure', 'table' => 'com:pages.database.table.orderings', 'columns' => array('title', 'custom')), 'com:pages.database.behavior.closurable' => array('table' => 'com:pages.database.table.closures')), 'filters' => array('params' => 'ini')));
     parent::_initialize($config);
 }
コード例 #15
0
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('filters' => array('slug' => 'cmd', 'path' => 'com:files.filter.path', 'parameters' => 'json'), 'behaviors' => array('sluggable' => array('columns' => array('id', 'title')))));
     parent::_initialize($config);
 }
コード例 #16
0
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'activities', 'behaviors' => array('creatable', 'identifiable')));
     parent::_initialize($config);
 }
コード例 #17
0
ファイル: articles.php プロジェクト: janssit/nickys.janss.be
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('name' => 'articles', 'behaviors' => array('creatable', 'modifiable', 'lockable', 'sluggable', 'revisable', 'publishable', 'orderable' => array('strategy' => 'flat'), 'com:languages.database.behavior.translatable', 'com:attachments.database.behavior.attachable', 'com:tags.database.behavior.taggable'), 'filters' => array('introtext' => array('html', 'tidy'), 'fulltext' => array('html', 'tidy'))));
     parent::_initialize($config);
 }