/** * RootNode constructor. * @param Node[] $nodes */ public function __construct(array $nodes = []) { parent::__construct(''); foreach ($nodes as $node) { $this->append($node); } }
/** * @param object $token source token * @param mixed string: an internally generated warning message about the source * bool: the source token is a @Media or @warn directive containing the message; True if this is a @warn directive * @param array parameters for the message */ public function __construct($token) { parent::__construct($token); preg_match(self::MATCH, $token->source, $matches); $this->token = $token; $this->media = $matches[self::MEDIA]; }
public function __construct($name, $value = null) { parent::__construct($name); if ($value) { $this->_children[] = new TextNode($value); } }
/** * Initialize text node with string. * * @param string|null $string text * @param integer $line source line */ public function __construct($string = null, $line) { parent::__construct($line); if (!empty($string)) { $this->lines = explode("\n", $string); } }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes * * @return Node_Database */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = PMA_Util::getImage('s_db.png', __('Database operations')); $this->links = array('text' => $GLOBALS['cfg']['DefaultTabDatabase'] . '?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $_SESSION[' PMA_token '], 'icon' => 'db_operations.php?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $_SESSION[' PMA_token ']); $this->classes = 'database'; }
public function __construct() { parent::__construct(); $this->load->model('image_model'); $this->load->model('image_upload_model'); $this->load->model('node_model'); $this->load->library('input'); $this->load->helper('form'); $this->load->helper('url'); // hardcoded the width, which is used several places for image size etc. if (is_numeric($this->config->item('base_image_width'))) { $this->width = $this->config->item('base_image_width'); } else { $this->width = 940; } // common additions to the 'data' array $this->data['upload'] = array(); // holds data about the upload $this->data['message'] = ''; $this->data['image_upload_js'] = "<script type='text/javascript' src='/js/jquery.imgareaselect.pack.js'></script>"; $input_data = array('id' => 'image_name', 'name' => 'image_name', 'value' => set_value('image_name')); $this->data['form']['image_name'] = form_input($input_data); // create a new directory if this is the first time the user is uploading images $this->path = $this->image_upload_model->create_image_directory($this->user['user_id']); }
/** * Initialize code node. * * @param string $code code string * @param boolean $buffering turn on buffering * @param integer $line source line */ public function __construct($code, $buffering = false, $line, $isVerbatimMode = false) { parent::__construct($line); $this->code = $code; $this->buffering = $buffering; $this->isVerbatimMode = $isVerbatimMode; }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes * * @return Node_View */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = PMA_Util::getImage('b_views.png'); $this->links = array('text' => 'sql.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s&pos=0' . '&token=' . $GLOBALS['token'], 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s' . '&token=' . $GLOBALS['token']); $this->classes = 'view'; }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes * * @return Node_Table */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = PMA_Util::getImage('b_browse.png'); $this->links = array('text' => $GLOBALS['cfg']['DefaultTabTable'] . '?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s' . '&pos=0&token=' . $GLOBALS['token'], 'icon' => $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] . '?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s&token=' . $GLOBALS['token']); $this->classes = 'table'; }
public function __construct($tag = null, $children = null, $attributes = null) { if ($this->isEmpty($tag)) { throw new HTML5Error(HTML5Error::EMPTY_NODE_TAG); } parent::__construct($tag, $attributes); $this->_children = array(); if (!$this->isEmpty($children)) { if (!is_array($children)) { $children = array($children); } if (is_array($children)) { foreach($children as $child) { $this->addChild($child); } } } }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes * * @return Node_Index */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = PMA_Util::getImage('b_index.png', __('Index')); $this->links = array('text' => 'tbl_indexes.php?server=' . $GLOBALS['server'] . '&db=%3$s&table=%2$s&index=%1$s' . '&token=' . $_SESSION[' PMA_token '], 'icon' => 'tbl_indexes.php?server=' . $GLOBALS['server'] . '&db=%3$s&table=%2$s&index=%1$s' . '&token=' . $_SESSION[' PMA_token ']); $this->classes = 'index'; }
/** * Context constructor. * @param string $name * @param Directive[] $directives */ public function __construct($name, array $directives = []) { parent::__construct($name); foreach ($directives as $directive) { $this->append($directive); } }
/** * @param object $token source token */ public function __construct($token) { parent::__construct($token); preg_match(self::MATCH, $token->source, $matches); $this->expression = $matches[self::EXPRESSION]; $this->isDo = $matches[self::LOOP] === WhileNode::IS_DO; }
/** * Initialises the class * * @param string $name An identifier for the new node * @param int $type Type of node, may be one of CONTAINER or OBJECT * @param bool $is_group Whether this object has been created * while grouping nodes * * @return Node_Function */ public function __construct($name, $type = Node::OBJECT, $is_group = false) { parent::__construct($name, $type, $is_group); $this->icon = PMA_Util::getImage('b_routines.png'); $this->links = array('text' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%2$s&item_name=%1$s&item_type=FUNCTION' . '&edit_item=1&token=' . $GLOBALS['token'], 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%2$s&item_name=%1$s&item_type=FUNCTION' . '&export_item=1&token=' . $GLOBALS['token']); $this->classes = 'function'; }
public function __construct() { parent::__construct(); // models $this->load->model('postage_model'); // libraries $this->load->library('input'); }
public function __construct( Safe $title, Safe $type = null ){ if( $type !== null ){ $this->_type = $type->toString(); }else{ $this->_type = null; } parent::__construct( $title ); }
/** * Create a new FertileNode with the given tag. The * tag cannot be NULL. */ public function __construct($tag = NULL) { if (GagawaUtil::gagawaIsEmpty($tag)) { throw new Exception("FertileNode's must have a tag " . "type!"); } parent::__construct($tag); $this->children_ = array(); }
public function __construct() { parent::__construct(); $this->load->database(); $this->load->library('input'); $this->load->model('basket_model'); $this->load->model('variation_model'); }
/** * @param object $token source token */ public function __construct($token) { parent::__construct($token); preg_match(self::MATCH, $token->source, $matches); if (empty($matches)) { return new Boolean(FALSE); } }
public function __construct(int $lineNr, string $layoutName, Date\DateNode $date, BgcCustomerNumberNode $customerNr, Account\BankgiroNode $bankgiro) { parent::__construct($lineNr); $this->setAttribute('layout_name', $layoutName); $this->setChild('date', $date); $this->setChild('customer_number', $customerNr); $this->setChild('bankgiro', $bankgiro); }
/** * @param \PHPSass\Parser Sass parser */ public function __construct($parser) { parent::__construct((object) ['source' => '', 'level' => -1, 'filename' => $parser->filename, 'line' => 0]); $this->parser = $parser; $this->script = new \PHPSass\Script\Parser(); $this->renderer = \PHPSass\Renderers\Renderer::getRenderer($parser->style); $this->root = $this; }
/** * Construct. * * @param string $name * @param string $label * @param array $nextStates * @param array $validations * @param array $modelStatus * @param array $roles * @param string $onInvalid */ public function __construct($name, $label, array $nextStates = array(), array $validations = array(), array $modelStatus = array(), array $roles = array(), $onInvalid = null) { parent::__construct($name, $nextStates, $validations); $this->label = $label; $this->modelStatus = $modelStatus; $this->roles = $roles; $this->onInvalid = $onInvalid; }
public function __construct() { parent::__construct(); $this->load->model('node_model'); $this->load->helper('date_convert_helper'); // now $this->now = get_now(); }
/** * @param object $token source token */ public function __construct($token) { parent::__construct($token); preg_match(self::MATCH, $token->source, $matches); if (empty($matches)) { return new \PHPSass\Script\Literals\Boolean(FALSE); } $this->statement = $matches[self::STATEMENT]; }
public function __construct() { parent::__construct(); $this->load->model('basket_model'); $this->load->model('node_model'); $this->load->model('order_model'); $this->load->model('variation_model'); $this->load->library('cart'); }
/** * @param object $token source token * @throws EachNodeException */ public function __construct($token) { parent::__construct($token); if (!preg_match(self::MATCH, $token->source, $matches)) { throw new EachNodeException('Invalid @each directive', $this); } $this->variable = trim($matches[self::VARIABLE]); $this->in = $matches[self::IN]; }
/** * Initialises the class * * @param string $name An identifier for the new node * * @return Node_Database_Container */ public function __construct($name) { parent::__construct($name, Node::CONTAINER); $new = PMA_NodeFactory::getInstance('Node', _pgettext('Create new database', 'New')); $new->isNew = $GLOBALS['is_create_db_priv']; $new->icon = PMA_Util::getImage('b_newdb.png', ''); $new->links = array('text' => 'server_databases.php?server=' . $GLOBALS['server'] . '&token=' . $GLOBALS['token'], 'icon' => 'server_databases.php?server=' . $GLOBALS['server'] . '&token=' . $GLOBALS['token']); $new->classes = 'new_database italics'; $this->addChild($new); }
/** * @param object $token source token * @param bool $if TRUE for an "if" node, FALSE for an "else if | else" node */ public function __construct($token, $if = TRUE) { parent::__construct($token); if ($if) { preg_match(self::MATCH_IF, $token->source, $matches); $this->expression = $matches[IfNode::IF_EXPRESSION]; } else { preg_match(self::MATCH_ELSE, $token->source, $matches); $this->expression = sizeof($matches) == 1 ? NULL : $matches[IfNode::ELSE_EXPRESSION]; } }
/** * @param object $token source token */ public function __construct($token) { preg_match(self::MATCH, $token->source, $matches); parent::__construct($token); if (empty($matches)) { throw new MixinDefinitionNodeException('Invalid Mixin', $this); } $this->name = $matches[self::NAME]; if (isset($matches[self::ARGUMENTS])) { $this->args = \PHPSass\Script\ScriptFunction::extractArgs($matches[self::ARGUMENTS], TRUE, new Context()); } }
/** * @param object $token source token * @throws ForNodeException */ public function __construct($token) { parent::__construct($token); if (!preg_match(self::MATCH, $token->source, $matches)) { throw new ForNodeException('Invalid @for directive', $this); } $this->variable = $matches[self::VARIABLE]; $this->from = $matches[self::FROM]; $this->to = $matches[self::TO]; $this->inclusive = $matches[self::INCLUSIVE] === ForNode::IS_INCLUSIVE; $this->step = empty($matches[self::STEP]) ? 1 : $matches[self::STEP]; }