/** * Constructor, adds head elements and initializes some variables * * @param string $classname The object class we're using * @param string $parent_field Where to look for children */ public function __construct($classname, $parent_field) { parent::__construct(); $this->_object_class = $classname; $this->_parent_field = $parent_field; self::add_head_elements(); }
/** * Constructor, takes classname or object, resolved MgdSchema root class automagically * * @param string/midgard_object $src classname or object */ public function __construct($src) { $this->_component = 'midcom.helper.reflector'; parent::__construct(); // Handle object vs string if (is_object($src)) { $original_class = get_class($src); } else { $original_class = $src; } // Resolve root class name $this->mgdschema_class = self::resolve_baseclass($original_class); // Could not resolve root class name if (empty($this->mgdschema_class)) { debug_add("Could not determine MgdSchema baseclass for '{$original_class}'", MIDCOM_LOG_ERROR); return; } // Instantiate midgard reflector if (!class_exists($this->mgdschema_class)) { return; } $this->_mgd_reflector = new midgard_reflection_property($this->mgdschema_class); // Instantiate dummy object $this->_dummy_object = new $this->mgdschema_class(); }
public function __construct(midcom_db_person $person = null) { if (null !== $person) { $this->_person = $person; $this->_account = midcom_core_account::get($person); } parent::__construct(); }
public function __construct($schemadb = null) { parent::__construct(); if (null === $schemadb) { $this->_schemadb = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb_formmailer')); } else { $this->_schemadb = $schemadb; } }
/** * Initializes the class. The real startup is done by the initialize() call. */ public function __construct($person) { $this->_component = 'org.routamc.positioning'; if (!is_a($person, 'midcom_db_person')) { $this->_person = null; return false; } $this->_person = $person; parent::__construct(); }
public function __construct() { $this->_component = 'org.openpsa.core'; if (!midcom::get('componentloader')->is_loaded($this->_component)) { midcom::get('componentloader')->load($this->_component); } parent::__construct(); $this->components = $this->_config->get('siteconfig_components'); $this->load_snippet(); }
/** * Initializes the class with a given feed */ public function __construct($feed) { $this->_feed = $feed; $this->_node = new midcom_db_topic($this->_feed->node); $this->_component = 'net.nemein.rss'; if ($this->_node->component) { $this->_node_config = midcom_baseclasses_components_configuration::get($this->_node->component, 'config'); } parent::__construct(); }
public function __construct($target_node, $target_object, $new_wikipage = null) { parent::__construct(); $this->target_node = $target_node; $this->target = midcom::get('dbfactory')->get_object_by_guid($target_object); $this->wiki = midcom_helper_misc::find_node_by_component('net.nemein.wiki'); if ($new_wikipage) { $this->new_wikipage = rawurlencode(str_replace('/', '-', $new_wikipage)); } }
/** * Constructor * * @param string $id Id string for the map */ public function __construct($id, $type = null) { $this->id = $id; $this->_component = 'org.routamc.positioning'; parent::__construct(); if (is_null($type)) { $this->type = $this->_config->get('map_provider'); } else { $this->type = $type; } $this->api_key = $this->_config->get('map_api_key'); }
public function __construct($classname, $pager_id) { $this->_component = 'org.openpsa.qbpager'; parent::__construct(); $this->_limit =& $this->results_per_page; $this->_pager_id = $pager_id; $this->_midcom_qb = midcom::get('dbfactory')->new_query_builder($classname); // Make another QB for counting, we need to do this to avoid trouble with core internal references system $this->_midcom_qb_count = midcom::get('dbfactory')->new_query_builder($classname); if (!$this->_sanity_check()) { //TODO: throw error? } $this->_prefix = 'org_openpsa_qbpager_' . $this->_pager_id . '_'; }
/** * Initializes the class and stores the selected person to be shown * The argument should be a MidgardPerson object. In the future DM * Array format will also be supported. * * @param mixed $person Person to display either as MidgardPerson or Datamanager array */ public function __construct($person = null) { parent::__construct(); if (null === self::$_contacts_url) { $siteconfig = org_openpsa_core_siteconfig::get_instance(); self::$_contacts_url = $siteconfig->get_node_full_url('org.openpsa.contacts'); } // Read properties of provided person object/DM array // TODO: Handle groups as well if (is_object($person)) { $this->_data_read_ok = $this->read_object($person); } else { if (is_array($person)) { $this->_data_read_ok = $this->read_array($person); } } }
public function __construct($args) { $this->_component = 'org.routamc.positioning'; parent::__construct(); $this->_data = array(); if (isset($args['start_message'])) { if (is_bool($args['start_message']) && $args['start_message']) { $this->_data[''] = $this->_l10n->get('select your country'); } else { if (is_string($args['start_message'])) { $this->_data[''] = $args['start_message']; } } } $qb = org_routamc_positioning_country_dba::new_query_builder(); $qb->add_constraint('code', '<>', ''); $qb->add_order('name', 'ASC'); $countries = $qb->execute_unchecked(); if (count($countries) == 0) { debug_add('No countries found. You have to use org.routamc.positioning to import countries to database.'); } $this->_populate_data($countries); }
public function __construct($object, &$request_data) { parent::__construct(); $this->_object = $object; $this->_object_path = $this->get_object_path(); $this->_request_data =& $request_data; $this->root_types = midcom_helper_reflector_tree::get_root_classes(); if (array_key_exists('current_type', $this->_request_data)) { $this->expanded_root_types[] = $this->_request_data['current_type']; } else { if (isset($this->_object)) { $object = $this->_object; if (!empty($this->_object_path)) { $object = midcom::get('dbfactory')->get_object_by_guid($this->_object_path[0]); } foreach ($this->root_types as $root_type) { if (is_a($object, $root_type) || midcom_helper_reflector::is_same_class($root_type, $object->__midcom_class_name__)) { $this->expanded_root_types[] = $root_type; break; } } } } }
/** * Initializes the class. * * @param boolean $delete_missing whether to delete missing items from database */ public function __construct($delete_missing = false) { $this->_component = 'midcom.helper.filesync'; $this->delete_missing = $delete_missing; parent::__construct(); }
/** * Initializes the class */ public function __construct() { $this->_component = 'org.openpsa.httplib'; parent::__construct(); }
public function __construct(net_nemein_wiki_wikipage $page) { $this->_page = $page; parent::__construct(); }
public function __construct($backend = 'try_default', $backend_params = array()) { $this->_component = 'org.openpsa.mail'; parent::__construct(); $this->encoding = $this->_i18n->get_current_charset(); $this->_backend = org_openpsa_mail_backend::get($backend, $backend_params); $this->headers['X-Originating-IP'] = '[' . $_SERVER['REMOTE_ADDR'] . ']'; $this->headers['X-Mailer'] = "PHP/" . phpversion() . ' /OpenPSA/' . midcom::get('componentloader')->get_component_version($this->_component) . '/' . get_class($this->_backend); }
/** * Initializes the class. The real startup is done by the initialize() call. */ public function __construct($object) { $this->_component = 'org.routamc.positioning'; $this->_object = $object; parent::__construct(); }
/** * Initializes the class. The real startup is done by the initialize() call. */ public function __construct() { $this->_component = 'org.routamc.positioning'; parent::__construct(); }
public function __construct() { $this->_component = 'net.nemein.rss'; parent::__construct(); }
/** * Construct a schema, takes a schema snippet URI resolvable through the * midcom_helper_misc::get_snippet_content() helper function. * * @param mixed $schemadb Either the path or the already loaded schema database * to use. * @param string $name The name of the Schema to use. It must be a member in the * specified schema database. If unspecified, the default schema is used. * @see midcom_helper_misc::get_snippet_content() */ public function __construct($schemadb, $name = null, $schemadb_path = null) { $this->_component = 'midcom.helper.datamanager2'; parent::__construct(); $this->_schemadb_path = $schemadb_path; $this->_load_schemadb($schemadb); if ($name === null) { reset($this->_raw_schemadb); $name = key($this->_raw_schemadb); } $this->_load_schema($name); }
public function __construct() { $this->_component = 'org.openpsa.notifications'; parent::__construct(); }
/** * Initializes the class and sets the selected date to be shown * * @param int $year Selected year YYYY * @param int $month Selected month MM * @param int $day Selected day DD */ public function __construct($year = null, $month = null, $day = null) { parent::__construct(); // Default time shown is current if ($year) { $this->year = $year; } else { $this->year = date('Y'); } if ($month) { $this->month = $month; } else { $this->month = date('m'); } if ($day) { $this->day = $day; } else { $this->day = date('d'); } }
/** * The constructor loads the schema database to use but does nothing else * so far. * * @param Array &$schemadb A list of midcom_helper_datamanager2_schema instances, * indexed by their schema name. This member is taken by reference. * @see midcom_helper_datamanager2_schema::load_database() */ public function __construct(array &$schemadb) { parent::__construct(); $this->_schemadb =& $schemadb; }
/** * Initializes the class. The real startup is done by the initialize() call. */ public function __construct() { $this->_component = 'midcom.helper.datamanager2'; parent::__construct(); }
/** * Creates the storage interface class, and initializes it to a given data schema. * Specific storage implementation subclasses will need to expand this constructor * to take care of linking to the right storage object, where applicable. * * @param midcom_helper_datamanager2_schema &$schema The data schema to use for processing. */ public function __construct($schema) { parent::__construct(); $this->_schema = $schema; }
/** * Initializes the Form manager with a list of types for a given schema. * * @param midcom_helper_datamanager2_schema &$schema The schema to use for processing. This * variable is taken by reference. * @param Array &$types A list of types matching the passed schema, used as a basis for the * form types. This variable is taken by reference. */ public function __construct(midcom_helper_datamanager2_schema $schema, &$types, $state = 'edit') { $this->_component = 'midcom.helper.datamanager2'; parent::__construct(); $this->_schema = $schema; $this->_types =& $types; $this->state = $state; }
public function __construct() { parent::__construct(); $this->_component = 'org.openpsa.smslib'; }
public function __construct($recipient) { $this->_component = 'org.openpsa.notifications'; $this->recipient = midcom_db_person::get_cached($recipient); parent::__construct(); }