/** * Init */ public function init() { parent::init(); if (access('Dev.*') && cogear()->config->development) { hook('done', array($this, 'finish')); } }
/** * Initialize */ public function init() { parent::init(); foreach (cogear()->gears as $gear) { if (is_array($gear->access)) { foreach ($gear->access as $rule => $rights) { $name = $gear->gear . '.' . $rule; // Array of user roles if (is_array($rights)) { if (in_array(role(), $rights)) { $this->rights->{$name} = TRUE; } else { $this->rights->{$name} = FALSE; } } else { if (is_string($rights)) { $callback = new Callback(array($gear, $rights)); if ($callback->check()) { $this->rights->{$name} = $callback; } } elseif (is_bool($rights)) { $this->rights->{$name} = $rights; } } } } } }
/** * Init */ public function init() { parent::init(); if ($dsn = $this->get('database.dsn')) { $config = parse_url($dsn); if (isset($config['query'])) { parse_str($config['query'], $query); $config += $query; } if (!isset($config['host'])) { $config['host'] = 'localhost'; } if (!isset($config['user'])) { $config['user'] = '******'; } if (!isset($config['pass'])) { $config['pass'] = ''; } if (!isset($config['prefix'])) { $config['prefix'] = $this->get('database.default_prefix', ''); } $config['database'] = trim($config['path'], '/'); $driver = 'Db_Driver_' . ucfirst($config['scheme']); if (!class_exists($driver)) { return Message::error(t('Database driver <b>%s</b> not found.', 'Database errors', ucfirst($config['scheme']))); } $this->driver = new $driver($config); $this->hook('done', array($this, 'showErrors')); $this->hook('debug', array($this, 'trace')); cogear()->db = $this->driver; } else { die('Couldn\'t connect to database.'); } }
/** * Init */ public function init() { parent::init(); $this->get = new Core_ArrayObject($_GET); $this->post = new Core_ArrayObject($_POST); $this->cookies = new Core_ArrayObject($_COOKIE); }
/** * Init */ public function init() { parent::init(); $cogear = getInstance(); Form::$types['file'] = 'Upload_Ajax_Form_File'; Form::$types['image'] = 'Upload_Ajax_Form_Image'; }
/** * Init */ public function init() { parent::init(); if (Ajax::is()) { event('ajax.hashchange'); } }
/** * Init */ public function init() { parent::init(); hook('form.page-createdit.init', array($this, 'extendPageForm')); hook('Pages.showPage.after', array($this, 'attachCommentsToPage')); hook('stack.Page.info', array($this, 'extendPageInfo')); allow_role(array('comments post'), 100); }
/** * Init */ public function init() { $this->router->addRoute('users:maybe', array($this, 'users')); parent::init(); $this->current = new User_Object(); $this->current->init(); new User_Menu(); $this->getRoles(); }
/** * Init * * With inheritance */ public function init() { $parent = $this->reflection->getParentClass(); if ($parent->name != 'Gear' && $parent->name != 'Theme') { $theme = new $parent->name(); $theme->init(); } parent::init(); }
/** * Инициализация */ public function init() { $config = config('database'); $db = Db::factory('system', $config); if ($db->connect()) { parent::init(); $this->object($db); } }
/** * Init */ public function init() { parent::init(); $cogear = getInstance(); $this->api = new Loginza_API(); hook('form.user-login.result.before', array($this, 'hookUserForm')); hook('form.user-register.result.before', array($this, 'hookUserForm')); hook('form.user-profile.init', array($this, 'hookUserProfile')); }
/** * Init */ public function init() { parent::init(); $cogear = getInstance(); $cogear->router->addRoute(':index', array($this, 'index'), TRUE); $url = config('pages.url', Pages_Gear::DEFAULT_PAGE_URL); $cogear->router->addRoute(str_replace(array('.', '<id>', '<url>'), array('\\.', '(?P<id>\\d+)', '.+'), $url), array($this, 'catchPage'), TRUE); allow_role(array('pages create'), 100); }
/** * Init */ public function init() { parent::init(); if (!class_exists('ZipArchive')) { error(t('Для того, чтобы система работа корректно, вам необходимо установить расширение ZIP для PHP или же использовать версию PHP выше 5.3.')); } else { // $this->object(new ZipArchive()); } }
/** * Init */ public function init() { $this->regions = new Core_ArrayObject(); hook('gear.request', array($this, 'handleGearRequest')); if ($favicon = config('theme.favicon')) { hook('theme.head.meta.after', array($this, 'renderFavicon')); } parent::init(); }
/** * Init */ public function init() { parent::init(); Template::bindGlobal('meta', $this->info); title(t(config('site.name', SITE_URL))); hook('head', array($this, 'head'), 0); hook('menu.setActive', array($this, 'menuTitleHook')); hook('Pages.showPage.before', array($this, 'showObjectTitle')); hook('admin.gear.request', array($this, 'showObjectTitle')); }
/** * Init */ public function init() { parent::init(); if ($this->status() == Gears::ENABLED) { $this->router->bind(':index', array($this, 'index'), TRUE); if (!check_route('^install')) { redirect(l('/install')); } } }
/** * Initializer */ public function init() { parent::init(); if (access('Admin.*')) { new Menu_Auto(array('name' => 'admin', 'template' => 'Admin/templates/menu', 'render' => 'before')); css($this->folder . '/css/menu.css', 'head'); js($this->folder . '/js/menu.js', 'head'); if ('admin' == $this->router->getSegments(0)) { $this->bc = new Breadcrumb_Object(array('name' => 'admin.breadcrumb', 'title' => TRUE, 'titleActiveOnly' => FALSE, 'elements' => array(array('link' => l('/admin'), 'label' => icon('home') . ' ' . t('Панель управления'))))); } } }
/** * Init */ public function init() { parent::init(); if ($rules = $this->system_cache->read('access/rules', TRUE)) { $this->rules->adopt($rules); } if ($roles = $this->system_cache->read('access/roles', TRUE)) { $this->roles->adopt($roles); } $this->getRights(); hook('exit', array($this, 'save')); }
/** * Init */ public function init() { parent::init(); hook('menu.admin.sidebar', array($this, 'adminMenuLink')); }
/** * Init */ public function init() { parent::init(); $cogear = getInstance(); }
/** * Initializer */ public function init() { $cogear = getInstance(); $this->settings->theme = 'Admin_Theme'; parent::init(); hook('user_cp.render.before', array($this, 'hookControlPanel')); }
/** * Init */ public function init() { parent::init(); hook('form.render', array($this, 'showGoBackButton')); }
/** * Initialization */ public function init() { parent::init(); $this->addPoint('system.begin'); hook('done', array($this, 'finalPoint')); }
/** * Init */ public function init() { $this->router->addRoute(':index', array($this, 'index'), TRUE); parent::init(); new Install_Menu(); }
/** * Init */ public function init() { parent::init(); hook('ignite', array($this, 'check')); $this->key = $this->keyGen(); }
/** * Init */ public function init() { parent::init(); Form::$types['editor'] = self::$editors[config('wysiwyg.editor', 'redactor')]; }
/** * Конструктор */ public function init() { parent::init(); // bind_route('user/([^/]+)/posts:maybe', array($this, 'list_action'), TRUE); // bind_route('user/([^/]+)/drafts:maybe', array($this, 'drafts_action'), TRUE); }
/** * Init */ public function init() { parent::init(); Wysiwyg_Gear::$editors['elRTE'] = 'elRTE_Editor'; }
/** * Init */ public function init() { parent::init(); $this->object(new User_Object()); $this->object()->init(); }
/** * Init */ public function init() { parent::init(); $cogear = getInstance(); $this->setRules(); $this->setRights(); }