Exemplo n.º 1
0
 public static function install(array $options = array())
 {
     $toret = parent::install($options);
     $toret = Hook::add('update', 'post', __CLASS__, array('global' => true, 'description' => 'Create the following revision of a post after the content has been updated.')) && $toret;
     $toret = Hook::add('create', 'post', __CLASS__, array('global' => true, 'description' => 'Add the first revision of the content after the content has been created.')) && $toret;
     return $toret;
 }
Exemplo n.º 2
0
 public static function install(array $options = array())
 {
     $toret = parent::install($options);
     $toret = Hook::add('output', 'pre', get_called_class(), array('global' => 1)) && $toret;
     $toret = Permission::add('anonymous', 'add', get_called_class()) && $toret;
     $toret = Permission::add('authenticated', 'add', get_called_class()) && $toret;
     return $toret;
 }
Exemplo n.º 3
0
 public static function install(array $options = array())
 {
     $options['drop_table'] = array_key_exists('drop_table', $options) ? $options['drop_table'] : true;
     $toret = parent::install($options);
     foreach (self::getDefaults() as $role) {
         $toret = self::add($role['name'], $role['description'], array('id' => $role['id'], 'active' => $role['active'])) && $toret;
     }
     return $toret;
 }
Exemplo n.º 4
0
 public static function install(array $options = array())
 {
     $options['drop_table'] = array_key_exists('drop_table', $options) ? $options['drop_table'] : true;
     $toret = parent::install($options);
     foreach (self::getDefaults() as $assignment) {
         if (GateKeeper::assign($assignment['role'], $assignment['access_type'], $assignment['access_id'])) {
             Backend::addSuccess('Added assignment to ' . $assignment['role']);
             $toret = $toret && true;
         } else {
             Backend::addError('Could not add assignment to ' . $assignment['role']);
             $toret = false;
         }
     }
     return $toret;
 }
Exemplo n.º 5
0
 public static function install(array $options = array())
 {
     $toret = parent::install($options);
     $toret = Permission::add('anonymous', 'display', get_called_class()) && $toret;
     $toret = Permission::add('authenticated', 'display', get_called_class()) && $toret;
     $toret = Permission::add('anonymous', 'list', get_called_class()) && $toret;
     $toret = Permission::add('authenticated', 'list', get_called_class()) && $toret;
     $toret = Hook::add('table_display', 'post', get_called_class(), array('global' => 1)) && $toret;
     $toret = Hook::add('table_update', 'pre', get_called_class(), array('global' => 1)) && $toret;
     $toret = Hook::add('table_update', 'post', get_called_class(), array('global' => 1)) && $toret;
     $toret = Hook::add('table_create', 'post', get_called_class(), array('global' => 1)) && $toret;
     return $toret;
 }
Exemplo n.º 6
0
 public static function install(array $options = array())
 {
     $toret = parent::install($options);
     $toret = Hook::add('start', 'pre', __CLASS__, array('global' => true, 'sequence' => 1000)) && $toret;
     return $toret;
 }
Exemplo n.º 7
0
 public static function install(array $options = array())
 {
     $toret = parent::install($options);
     Hook::add('init', 'pre', get_called_class()) && $toret;
     return $toret;
 }
Exemplo n.º 8
0
 public static function install(array $options = array())
 {
     $options['install_model'] = array_key_exists('install_model', $options) ? $options['install_model'] : false;
     $toret = parent::install($options);
     foreach (self::getDefaults() as $permit) {
         GateKeeper::permit($permit['role'], $permit['action'], $permit['subject'], $permit['subject_id'], $permit['control']);
         if (Controller::$debug) {
             Backend::addSuccess('Added permission to ' . $permit['action'] . ' to ' . $permit['role']);
         }
     }
     return $toret;
 }
Exemplo n.º 9
0
 public static function install(array $options = array())
 {
     $toret = parent::install($options);
     $toret = Hook::add('update', 'post', get_called_class(), array('description' => 'Check for enabled / requested themes, and change the view name accordingly.')) && $toret;
     return $toret;
 }
Exemplo n.º 10
0
 public static function install(array $options = array())
 {
     $options['install_model'] = array_key_exists('install_model', $options) ? $options['install_model'] : true;
     $result = parent::install($options);
     if (!Backend::getDB('default')) {
         return $result;
     }
     $result = Hook::add('init', 'post', get_called_class(), array('global' => true, 'sequence' => 0)) && $result;
     $result = Hook::add('start', 'pre', get_called_class(), array('global' => true)) && $result;
     $result = Hook::add('finish', 'post', get_called_class(), array('global' => true)) && $result;
     $result = Permission::add('anonymous', 'super_signup', get_called_class()) && $result;
     $result = Permission::add('anonymous', 'signup', get_called_class()) && $result;
     $result = Permission::add('anonymous', 'confirm', get_called_class()) && $result;
     $result = Permission::add('anonymous', 'login', get_called_class()) && $result;
     $result = Permission::add('authenticated', 'login', get_called_class()) && $result;
     $result = Permission::add('authenticated', 'logout', get_called_class()) && $result;
     $result = Permission::add('authenticated', 'display', get_called_class()) && $result;
     $result = Permission::add('authenticated', 'update', get_called_class()) && $result;
     $result = Permission::add('authenticated', 'change_password', get_called_class()) && $result;
     return $result;
 }
Exemplo n.º 11
0
 public static function install(array $options = array())
 {
     $options['drop_table'] = array_key_exists('drop_table', $options) ? $options['drop_table'] : true;
     $options['install_model'] = array_key_exists('install_model', $options) ? $options['install_model'] : false;
     $toret = parent::install($options);
     return $toret;
 }
Exemplo n.º 12
0
 public static function install(array $options = array())
 {
     $options['install_model'] = array_key_exists('install_model', $options) ? $options['install_model'] : false;
     $result = parent::install($options);
     if (!Backend::getDB('default')) {
         return $result;
     }
     Hook::add('init', 'pre', get_called_class()) && $result;
     return $result;
 }
Exemplo n.º 13
0
 public static function install(array $options = array())
 {
     $toret = parent::install($options);
     return $toret;
 }