コード例 #1
0
 /**
  * RootNode constructor.
  * @param Node[] $nodes
  */
 public function __construct(array $nodes = [])
 {
     parent::__construct('');
     foreach ($nodes as $node) {
         $this->append($node);
     }
 }
コード例 #2
0
ファイル: MediaNode.php プロジェクト: lopo/phpsass
 /**
  * @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];
 }
コード例 #3
0
ファイル: susax.php プロジェクト: neel/bong
 public function __construct($name, $value = null)
 {
     parent::__construct($name);
     if ($value) {
         $this->_children[] = new TextNode($value);
     }
 }
コード例 #4
0
ファイル: TextNode.php プロジェクト: clthck/slimphp
 /**
  * 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);
     }
 }
コード例 #5
0
 /**
  * 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';
 }
コード例 #6
0
ファイル: image_upload.php プロジェクト: toni-leigh/core
 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']);
 }
コード例 #7
0
ファイル: CodeNode.php プロジェクト: clthck/slimphp
 /**
  * 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;
 }
コード例 #8
0
ファイル: Node_View.class.php プロジェクト: fanscky/HTPMS
 /**
  * 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'] . '&amp;db=%2$s&amp;table=%1$s&amp;pos=0' . '&amp;token=' . $GLOBALS['token'], 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s' . '&amp;token=' . $GLOBALS['token']);
     $this->classes = 'view';
 }
コード例 #9
0
ファイル: Node_Table.class.php プロジェクト: fanscky/HTPMS
 /**
  * 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'] . '&amp;db=%2$s&amp;table=%1$s' . '&amp;pos=0&amp;token=' . $GLOBALS['token'], 'icon' => $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] . '?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;table=%1$s&amp;token=' . $GLOBALS['token']);
     $this->classes = 'table';
 }
コード例 #10
0
ファイル: NodeContainer.php プロジェクト: nico13051995/IntITA
		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);
					}
				}
			}
		}
コード例 #11
0
 /**
  * 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'] . '&amp;db=%3$s&amp;table=%2$s&amp;index=%1$s' . '&amp;token=' . $_SESSION[' PMA_token '], 'icon' => 'tbl_indexes.php?server=' . $GLOBALS['server'] . '&amp;db=%3$s&amp;table=%2$s&amp;index=%1$s' . '&amp;token=' . $_SESSION[' PMA_token ']);
     $this->classes = 'index';
 }
コード例 #12
0
ファイル: Context.php プロジェクト: madkom/nginx-configurator
 /**
  * Context constructor.
  * @param string $name
  * @param Directive[] $directives
  */
 public function __construct($name, array $directives = [])
 {
     parent::__construct($name);
     foreach ($directives as $directive) {
         $this->append($directive);
     }
 }
コード例 #13
0
ファイル: WhileNode.php プロジェクト: lopo/phpsass
 /**
  * @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;
 }
コード例 #14
0
 /**
  * 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'] . '&amp;db=%2$s&amp;item_name=%1$s&amp;item_type=FUNCTION' . '&amp;edit_item=1&amp;token=' . $GLOBALS['token'], 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] . '&amp;db=%2$s&amp;item_name=%1$s&amp;item_type=FUNCTION' . '&amp;export_item=1&amp;token=' . $GLOBALS['token']);
     $this->classes = 'function';
 }
コード例 #15
0
ファイル: postage.php プロジェクト: toni-leigh/core
 public function __construct()
 {
     parent::__construct();
     // models
     $this->load->model('postage_model');
     // libraries
     $this->load->library('input');
 }
コード例 #16
0
	public function __construct( Safe $title, Safe $type = null ){
		if( $type !== null ){
			$this->_type	= $type->toString();
		}else{
			$this->_type	= null;
		}
		parent::__construct( $title );
	}
コード例 #17
0
ファイル: FertileNode.php プロジェクト: hoswey/gagawa
 /**
  * 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();
 }
コード例 #18
0
ファイル: variation.php プロジェクト: toni-leigh/core
 public function __construct()
 {
     parent::__construct();
     $this->load->database();
     $this->load->library('input');
     $this->load->model('basket_model');
     $this->load->model('variation_model');
 }
コード例 #19
0
ファイル: ContentNode.php プロジェクト: lopo/phpsass
 /**
  * @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);
     }
 }
コード例 #20
0
ファイル: OpeningNode.php プロジェクト: byrokrat/autogiro
 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);
 }
コード例 #21
0
ファイル: RootNode.php プロジェクト: lopo/phpsass
 /**
  * @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;
 }
コード例 #22
0
 /**
  * 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;
 }
コード例 #23
0
ファイル: events.php プロジェクト: toni-leigh/shlinks
 public function __construct()
 {
     parent::__construct();
     $this->load->model('node_model');
     $this->load->helper('date_convert_helper');
     // now
     $this->now = get_now();
 }
コード例 #24
0
ファイル: ReturnNode.php プロジェクト: lopo/phpsass
 /**
  * @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];
 }
コード例 #25
0
ファイル: order.php プロジェクト: toni-leigh/core
 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');
 }
コード例 #26
0
ファイル: EachNode.php プロジェクト: lopo/phpsass
 /**
  * @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];
 }
コード例 #27
0
 /**
  * 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'] . '&amp;token=' . $GLOBALS['token'], 'icon' => 'server_databases.php?server=' . $GLOBALS['server'] . '&amp;token=' . $GLOBALS['token']);
     $new->classes = 'new_database italics';
     $this->addChild($new);
 }
コード例 #28
0
ファイル: IfNode.php プロジェクト: lopo/phpsass
 /**
  * @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];
     }
 }
コード例 #29
0
ファイル: MixinDefinitionNode.php プロジェクト: lopo/phpsass
 /**
  * @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());
     }
 }
コード例 #30
0
ファイル: ForNode.php プロジェクト: lopo/phpsass
 /**
  * @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];
 }