/** * (non-PHPdoc) * @see CronksBaseModel::initialize() */ public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); if (isset($parameters['instance'])) { $this->instance = $parameters['instance']; } $this->refresh(); }
/** * (non-PHPdoc) * @see CronksBaseModel::initialize() */ public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); // Init cronk categgory configurtion $tmp = (include AgaviConfigCache::checkConfig(AgaviConfig::get('core.config_dir') . '/cronks.xml')); self::$xml_categories = (array) $tmp[1]; // Init user objects $this->refreshUser(); }
public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); $this->api = $this->getContext()->getModel('Icinga.ApiContainer', 'Web'); $this->ds = $this->getParameter('datasources', array()); $this->ts = $this->getParameter('templates', array()); $this->chain = $this->getParameter('chain', array()); $this->rparam = $this->getParameter('rparam', array()); $this->tid = $this->getOid(); }
public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); if ($this->getParameter('security_only', false) !== true) { $this->cronks = $this->getContext()->getModel('Provider.CronksData', 'Cronks'); } if ($this->getParameter('cronkuid', false) !== false) { $this->setCronkUid($this->getParameter('cronkuid')); } }
/** * Agavi initialize method * @param AgaviContext $c * @param array $p */ public function initialize(AgaviContext $c, array $p = array()) { parent::initialize($c, $p); $this->api = $this->getContext()->getModel('Icinga.ApiContainer', 'Web')->getConnection(); // Enable custom variable search if configured if ((bool) AgaviConfig::get('modules.cronks.search.host_custom_variables')) { $this->mapping['host']['search'][] = 'HOST_CUSTOMVARIABLE_VALUE'; } if ((bool) AgaviConfig::get('modules.cronks.search.service_custom_variables')) { $this->mapping['service']['search'][] = 'SERVICE_CUSTOMVARIABLE_VALUE'; } }
public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); IcingaDoctrineDatabase::resetCurrentConnection(); $this->user = $this->getContext()->getUser(); if (AgaviConfig::get('core.data_dir') !== null) { $this->cacheDir = AgaviConfig::get('core.data_dir') . '/tmp'; } else { $this->cacheDir = '/tmp'; } if (!is_dir($this->cacheDir)) { throw new AppKitModelException('Cache dir for CronksUserCacheDataModel does not exist: ' . $this->cacheDir); } }
public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); $this->__type = $this->getParameter('type'); $this->__oids = AppKitArrayUtil::trimSplit($this->getParameter('oids')); if (!in_array($this->__type, array(self::TYPE_HOST, self::TYPE_SERVICE))) { throw new AppKitModelException('Parameter type not valid!'); } if (!is_array($this->__oids)) { throw new AppKitModelException('oids must be an array'); } $model = $this->getContext()->getModel("ApiDataRequest", "Api"); $this->__request = $model->createRequestDescriptor($parameters["connection"]); }
public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); $this->agaviUser = $this->getContext()->getUser(); if ($this->agaviUser->isAuthenticated() === true) { $this->user = $this->agaviUser->getNsmUser(); $this->setPrincipals($this->user->getPrincipalsArray()); } else { throw new AppKitModelException('The model need an authenticated user'); } $this->initializeXmlData(); if (!isset($parameters['lazy'])) { $this->cronks = $this->getCronks(true); } }
public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); $this->commandDispatcher = $context->getModel("Commands.CommandDispatcher", "Api"); }
/** * @param AgaviContext $context * @param array $parameters */ public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); }
/** * (non-PHPdoc) * @see lib/agavi/src/model/AgaviModel#initialize($context, $parameters) */ public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); $this->tm = $this->getContext()->getTranslationManager(); $this->connectionName = isset($parameters["connection"]) ? $parameters["connection"] : "icinga"; }
public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); $this->serviceQuery = IcingaDoctrine_Query::create()->select('ss.servicestatus_id, ss.last_state_change')->from('IcingaServicestatus ss')->innerJoin('ss.instance i')->innerJoin('i.programstatus p')->andWhere('ss.service_object_id=?'); $this->hostQuery = IcingaDoctrine_Query::create()->select()->from('IcingaHoststatus hs')->innerJoin('hs.instance i')->innerJoin('i.programstatus p')->andWhere('hs.host_object_id=?'); }