コード例 #1
0
 /**
  * Get the json object for a screen
  * @param AppBuilderAPIElement $screen
  * @internal used by appbuilder
  * @return array
  */
 public static function getScreenAsObj($screen, $refreshAfter = 0)
 {
     $screenObj =& $screen->getObj();
     $obj = array('main' => $screenObj['id'], 'maintype' => $screen instanceof AppBuilderAPIApp ? 'app' : 'screen', 'data' => array('screens' => array(), 'images' => array(), 'items' => array(), 'styles' => array(), 'files' => array()), 'refreshAfter' => $refreshAfter);
     $screen->getObjects($obj['data']);
     return $obj;
 }
 /**
  * Get the xml element for this item
  * @param DOMDocument $xml
  * @return DOMElement
  * @deprecated since version 2.0
  */
 public function getNode($xml, $root = true)
 {
     $node = parent::getNode($xml);
     $mapNode = new AppBuilderAPIElement('map');
     $mapNode->setAttribute('title', $this->title);
     $this->applyStyle($mapNode);
     $mapNode = $mapNode->getNode($xml);
     $mapNode->appendChild($node);
     $itemsNode = new AppBuilderAPIElement('items');
     $this->applyStyle($itemsNode);
     $itemsNode = $itemsNode->getNode($xml);
     $itemsNode->appendChild($mapNode);
     $node = $itemsNode;
     if ($root) {
         $rootNode = $this->getRootNode($xml);
         $rootNode->setAttribute('type', 'map');
         $rootNode->appendChild($node);
         $node = $rootNode;
     }
     return $node;
 }
コード例 #3
0
 protected function getRootNode($xml)
 {
     $rootNode = new AppBuilderAPIElement('screen');
     $rootNode->setAttribute('updatedate', gmdate('j/n/Y H:i:s'));
     $rootNode->setAttribute('tabid', static::tabId());
     $rootNode->setAttribute('title', $this->title);
     $this->applyStyle($rootNode);
     $rootNode = $rootNode->getNode($xml);
     return $rootNode;
 }
コード例 #4
0
 public function getObjects(&$obj)
 {
     parent::getObjects($obj);
     $myObj =& $this->getObj();
     $myImage =& $this->getImageObject('image');
     if ($myImage) {
         $obj['images'][$myImage['id']] = $myImage;
     }
     $mySplashImage =& $this->getImageStyleObject('splash');
     if ($mySplashImage) {
         $obj['images'][$mySplashImage['id']] = $mySplashImage;
     }
     $ordering = 1;
     foreach ($this->tabs as $child) {
         $childObj =& $child->getObj();
         if ($childObj) {
             $childObj['app'] = $myObj['id'];
             $childObj['ordering'] = $ordering++;
         }
         $child->getObjects($obj);
     }
 }
コード例 #5
0
 protected function getClass()
 {
     return parent::getClass() . " item";
 }
 public function getNode($xml)
 {
     $node = parent::getNode($xml);
     $items = new AppBuilderAPIElement('items');
     $items = $items->getNode($xml);
     foreach ($this->options as $option) {
         $optionNode = new AppBuilderAPIElement('option');
         foreach ($option as $k => $v) {
             $optionNode->setAttribute($k, $v);
         }
         $optionNode = $optionNode->getNode($xml);
         $items->appendChild($optionNode);
     }
     $node->appendChild($items);
     return $node;
 }