Пример #1
0
 /**
  *
  * @param \DOMElement $items
  * @param \AppShed\Remote\XML\DOMDocument $xml
  * @param \AppShed\Remote\HTML\Settings $settings
  * @param \AppShed\Remote\Style\CSSDocument $css
  * @param array $javascripts
  *
  * @return \AppShed\Remote\Element\Item\Item[] of header items
  */
 protected function addHTMLChildren($items, $xml, $settings, $css, &$javascripts)
 {
     $items->appendChild($itemsInner = $xml->createElement('div', 'items-inner'));
     $itemsInner->appendChild($table = $xml->createElement('table'));
     $table->appendChild($row = $xml->createElement('tr'));
     $settings->pushCurrentScreen($this->getId());
     $i = 0;
     $headButtons = [];
     foreach ($this->children as $child) {
         if ($child->getHeaderItem()) {
             $headButtons[] = $child;
         } else {
             $childNode = $child->getHTMLNode($xml, $settings);
             if ($childNode) {
                 if ($i == $this->columns) {
                     $table->appendChild($row = $xml->createElement('tr'));
                     $i = 0;
                 }
                 $i++;
                 $row->appendChild($childNode);
             }
             $child->getCSS($css, $settings);
             $child->getJavascript($javascripts, $settings);
         }
     }
     while ($i < $this->columns) {
         $row->appendChild($xml->createElement('td'));
         $i++;
     }
     $settings->popCurrentScreen();
     return $headButtons;
 }
Пример #2
0
 /**
  *
  * @param \DOMElement $items
  * @param \AppShed\Remote\XML\DOMDocument $xml
  * @param \AppShed\Remote\HTML\Settings $settings
  * @param \AppShed\Remote\Style\CSSDocument $css
  * @param array $javascripts
  *
  * @return \AppShed\Remote\Element\Item\Item[] of header items
  */
 protected function addHTMLChildren($items, $xml, $settings, $css, &$javascripts)
 {
     $items->appendChild($itemsInner = $xml->createElement('script', ['type' => 'application/json']));
     $settings->pushCurrentScreen($this->getId());
     $locs = [];
     $headButtons = [];
     foreach ($this->children as $child) {
         if ($child->getHeaderItem()) {
             $headButtons[] = $child;
         } else {
             $locs[] = $child->getMarkerObject($xml, $settings);
             $child->getCSS($css, $settings);
             $child->getJavascript($javascripts, $settings);
         }
     }
     $itemsInner->appendChild($xml->createTextNode(json_encode($locs)));
     $settings->popCurrentScreen();
     return $headButtons;
 }
Пример #3
0
 /**
  *
  * @param \DOMElement $items
  * @param \AppShed\Remote\XML\DOMDocument $xml
  * @param \AppShed\Remote\HTML\Settings $settings
  * @param \AppShed\Remote\Style\CSSDocument $css
  * @param array $javascripts
  *
  * @return \AppShed\Remote\Element\Item\Item[] of header items
  */
 protected function addHTMLChildren($items, $xml, $settings, $css, &$javascripts)
 {
     $items->appendChild($itemsInner = $xml->createElement('div', 'items-inner'));
     $itemsInner->appendChild($table = $xml->createElement('table'));
     $table->appendChild($row = $xml->createElement('tr'));
     $settings->pushCurrentScreen($this->getId());
     $i = 0;
     $headButtons = [];
     foreach ($this->children as $child) {
         if ($child->getHeaderItem()) {
             $headButtons[] = $child;
         } else {
             $child->getCSS($css, $settings);
             $outerChild = new GalleryOuterImage($child->getThumbImage());
             $outerChild->copyStyles($child);
             $id = $child->getId(true);
             $outerChild->setId($id);
             if (!$child->getDisableInner()) {
                 $outerChild->setScreenLink($this->innerScreen, '#' . $child->getIdType() . $settings->getPrefix() . $child->getId());
             }
             $outerChildNode = $outerChild->getHTMLNode($xml, $settings);
             if ($outerChildNode) {
                 if ($i == $this->columns) {
                     $table->appendChild($row = $xml->createElement('tr'));
                     $i = 0;
                 }
                 $i++;
                 $row->appendChild($outerChildNode);
             }
         }
     }
     while ($i < $this->columns) {
         $row->appendChild($xml->createElement('td'));
         $i++;
     }
     $settings->popCurrentScreen();
     return $headButtons;
 }