protected function _parseTemplate($xml) { $template = new KObject(); foreach ($xml as $name) { if ($name->name() == 'form') { $template->set($name->name(), $name); } else { $template->set($name->name(), $name->data()); } } return $template; }
/** * Construct method, add a session if options are passed * * @author Stian Didriksen <*****@*****.**> * @param $config KConfig */ public function __construct(KConfig $config) { parent::__construct($config); if (isset($config->retry)) { $this->retry = $config->retry; } }
/** * Constructor * * Prevent creating instances of this class by making the contructor private * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config) { parent::__construct($config); // Set the view indentifier $this->_template = $config->template; }
/** * Constructor. * * @param KConfig $config An optional KConfig object with configuration options. */ public function __construct(KConfig $config) { parent::__construct($config); foreach ($config as $key => $value) { $this->{$key} = $value; } }
protected function _initialize(KConfig $config) { if (empty($config->adapters)) { $config->adapters = array('image', 'finfo'); } parent::_initialize($config); }
/** * Constructor. * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config) { parent::__construct($config); $this->_state_machine = new AnDomainSpaceState(); $this->_entities = $this->getService('anahita:domain.space.queue'); $this->_states = new AnObjectArray(); }
/** * Constructor. * * @param object An optional KConfig object with configuration options */ public function __construct( KConfig $config = null) { //If no config is passed create it if(!isset($config)) $config = new KConfig(); parent::__construct($config); }
/** * Constructor. * * @param KObjectConfig $config Configuration options */ public function __construct(KObjectConfig $config) { parent::__construct($config); //Auto register locators foreach ($config->locators as $locator) { $this->registerLocator($locator); } }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options * @return void */ protected function _initialize(KConfig $config) { $config->append(array( 'priority' => KCommand::PRIORITY_NORMAL, )); parent::_initialize($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options * @return void */ protected function _initialize(KConfig $config) { $config->append(array( 'data' => array(), )); parent::_initialize($config); }
/** * Constructor. * * @param KObjectConfig $config An optional ObjectConfig object with configuration options. */ public function __construct(KObjectConfig $config) { parent::__construct($config); //Create the queue $this->_queue = $this->getObject('lib:object.queue'); //The filter priority $this->_priority = $config->priority; }
/** * Constructor. * * @param KConfig $config An optional KConfig object with configuration options. */ public function __construct(KConfig $config) { parent::__construct($config); $this->_session = $config->session; if (!$this->_session instanceof ComConnectOauthServiceAbstract) { throw new InvalidArgumentException('Session must be an intance of ComConnectOauthServiceAbstract'); } }
/** * Constructor. * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config) { parent::__construct(null); $this->_store = $config->store; foreach ($config->resources as $resource) { $this->insert($resource); } }
protected function _initialize(KObjectConfig $config) { $config->append(array( 'path' => '' )); parent::_initialize($config); }
public function __construct(KConfig $options) { parent::__construct($options); $identifier = $options->identifier; $type = $identifier->type; $package = $identifier->package; $admin = JPATH_ADMINISTRATOR . '/components/' . $type . '_' . $package; $site = JPATH_ROOT . '/components/' . $type . '_' . $package; $media = JPATH_ROOT . '/media/' . $type . '_' . $package; $xmls = JFolder::files(JPATH_ADMINISTRATOR . '/components/' . $type . '_' . $package, '.xml$', 0, true); foreach ($xmls as $manifest) { $xml = simplexml_load_file($manifest); if (isset($xml['type'])) { break; } } if (empty($xml)) { return; } if (!$xml->deleted) { return; } KLoader::load('lib.joomla.filesystem.folder'); KLoader::load('lib.joomla.filesystem.file'); if ($xml->deleted->admin) { foreach ($xml->deleted->admin->children() as $name => $item) { if ($name == 'folder' && JFolder::exists($admin . '/' . $item)) { JFolder::delete($admin . '/' . $item); } if ($name == 'file' && JFile::exists($admin . '/' . $item)) { JFile::delete($admin . '/' . $item); } } } if ($xml->deleted->site) { if ($xml->deleted->site['removed'] && JFolder::exists($site)) { JFolder::delete($site); } foreach ($xml->deleted->site->children() as $name => $item) { if ($name == 'folder' && JFolder::exists($site . '/' . $item)) { JFolder::delete($site . '/' . $item); } if ($name == 'file' && JFile::exists($site . '/' . $item)) { JFile::delete($site . '/' . $item); } } } if ($xml->deleted->media) { foreach ($xml->deleted->media->children() as $name => $item) { if ($name == 'folder' && JFolder::exists($media . '/' . $item)) { JFolder::delete($media . '/' . $item); } if ($name == 'file' && JFile::exists($media . '/' . $item)) { JFile::delete($media . '/' . $item); } } } }
protected function _initialize($config) { try { $config->append(array('manifest' => null, 'translator' => $this->getService('translator'))); } catch (KServiceIdentifierException $e) { throw new KException('Please first upgrade EXTman to be able to use this extension.'); } parent::_initialize($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param array Options * @return array Options */ protected function _initialize(KConfig $options) { $name = isset($options->name) ? $options->name : (string) $this->node['name']; $id = isset($options->id) ? $options->id : isset($this->node['id']) ? (string) $this->node['id'] : $name; $label = isset($this->node['label']) ? (string) $this->node['label'] : false; $label = $label ? $label : KInflector::humanize((string) $this->node['name']); $options->append(array('parent' => false, 'identifier' => null, 'group' => false, 'fetchTooltip' => true, 'name' => $name, 'id' => $id, 'label' => $label)); parent::_initialize($options); }
/** * Constructor. * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config = null) { //If no config is passed create it if(!isset($config)) $config = new KConfig(); parent::__construct($config); $this->_object_set = new ArrayObject(); }
protected function _initialize(KConfig $config) { if (empty($config->adapters)) { $config->adapters = array('finfo'); } elseif (is_string($config->adapters)) { $config->adapters = array($config->adapters); } parent::_initialize($config); }
/** * Constructor. * * @param KObjectConfig $config A KObjectConfig object with configuration options */ public function __construct($config) { parent::__construct($config); //Set the date if (!$config->timezone instanceof DateTimeZone) { $config->timezone = new DateTimeZone($config->timezone); } //Set the date $this->_date = new DateTime($config->date, $config->timezone); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options. * @return void */ protected function _initialize(KConfig $config) { $config->append(array( 'dispatcher' => KFactory::get('koowa:event.dispatcher'), 'auto_connect' => true, 'priority' => KCommand::PRIORITY_NORMAL )); parent::_initialize($config); }
protected function _initialize(KConfig $config) { $config->append(array( 'storage_path' => 'docs', 'storage_name' => null, 'storage' => null, 'selector' => 'default', 'type' => $this->_identifier->name )); parent::_initialize($config); }
/** * Constructor. * * @param KObjectConfig $config Configuration options */ public function __construct(KObjectConfig $config) { parent::__construct($config); //Register the engines $engines = KObjectConfig::unbox($config->engines); foreach ($engines as $key => $value) { if (is_numeric($key)) { $this->registerEngine($value); } else { $this->registerEngine($key, $value); } } }
/** * Constructor. * * @param KObjectConfig $config Configuration options */ public function __construct(KObjectConfig $config) { parent::__construct($config); //Register the locators $locators = KObjectConfig::unbox($config->locators); foreach ($locators as $key => $value) { if (is_numeric($key)) { $this->registerLocator($value); } else { $this->registerLocator($key, $value); } } }
public function getLink($options = array()) { $option = $this->_options['option']; $view = KRequest::get('get.view', 'cmd'); // modify url $url = clone KRequest::url(); $query = new KObject(); $query->set($url->getquery(1)); //$query['view'] = 'settings'; $query->order = null; $query->direction = null; $query->limit = null; $query->offset = null; if (isset($query->tmpl)) { JTML::_('behavior.modal'); } $this->modal = true; //$query['layout']= 'default'; $query->set($options); $url->setQuery($query->get()); return $url; }
/** * Object constructor * * @param KObjectConfig $config An optional ObjectConfig object with configuration options */ public function __construct(KObjectConfig $config = null) { parent::__construct($config); //Set the chunk size $this->setChunkSize($config->chunk_size); $this->_type = $config->type; $this->_path = $config->path; $this->_mode = $config->mode; $this->_options = KObjectConfig::unbox($config->options); //Attach stream filters foreach ($config->filters as $key => $filter) { if (is_numeric($key)) { $this->addFilter($filter); } else { $this->addFilter($key, $filter); } } }
/** * Initializes the default configuration for the object. * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. */ protected function _initialize(KConfig $config) { $description = $this->_description; $properties = $description->getProperty(); $validations = array(); foreach ($properties as $property) { if ($property->isAttribute() && $property->getFormat()) { $validations[$property->getName()]['format'] = $property->getFormat(); } if ($property->isSerializable() && $property->isRequired()) { $validations[$property->getName()]['required'] = true; } if ($property->isSerializable() && $property->isUnique()) { $validations[$property->getName()]['uniqueness'] = array('scope' => array()); } } $config->append(array('validations' => $validations)); parent::_initialize($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options. * @return void */ protected function _initialize(KConfig $config) { $config->append(array('stack' => $this->getService('koowa:template.stack'), 'view' => null, 'command_chain' => new KCommandChain(), 'dispatch_events' => false, 'enable_callbacks' => false)); parent::_initialize($config); }
/** * Initializes the default configuration for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. * * @return void */ protected function _initialize(KConfig $config) { $config->append(array('folder' => 'assets')); parent::_initialize($config); }
/** * Initializes the default configuration for the object. * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. */ protected function _initialize(KConfig $config) { $config->append(array('controller' => null)); parent::_initialize($config); }