Esempio n. 1
0
 private function renderWindow()
 {
     $xml = new \DOMDocument();
     $node = $xml->appendChild($xml->createElement('DirectoryWindow'));
     $search = new \Difra\Unify\Search('WidgetsDirectory');
     $search->addCondition('directory', static::directory);
     $search->getListXML($node);
     return \Difra\View::render($xml, 'widget_directory', true);
 }
Esempio n. 2
0
 private function _viewWork($link)
 {
     $entry = new \Difra\Unify\Search('PortfolioEntry');
     $entry->addCondition('uri', $link);
     $list = $entry->getList();
     if (empty($list)) {
         throw new \Difra\View\HttpError(404);
     }
     $mainXml = $this->root->appendChild($this->xml->createElement('PortfolioWork'));
     $list[0]->getXML($mainXml);
     \Difra\Plugins\Portfolio::getWorkImagesXML($list[0]->id, $mainXml);
     $this->root->setAttribute('pageTitle', $list[0]->name);
 }
Esempio n. 3
0
 /**
  * Проверяет на дубликаты генерируемый ури работы портфолио
  * @param $title
  * @return bool
  */
 public static function checkURI($title)
 {
     $entry = new \Difra\Unify\Search('PortfolioEntry');
     $entry->addCondition('uri', \Difra\Locales::getInstance()->makeLink($title));
     $list = $entry->getList();
     return !is_null($list) ? false : true;
 }
Esempio n. 4
0
 public function editAction(\Difra\Param\AnyInt $id)
 {
     $mainXml = $this->root->appendChild($this->xml->createElement('PortfolioEntryEdit'));
     $mainXml->setAttribute('edit', true);
     $entryNode = $mainXml->appendChild($this->xml->createElement('entry'));
     $entry = \Difra\Unify::getObj('PortfolioEntry', $id->val());
     $entry->getXML($entryNode);
     $imagesNode = $entryNode->appendChild($this->xml->createElement('images'));
     $images = new \Difra\Unify\Search('PortfolioImages');
     $images->addCondition('portfolio', $entry->id);
     $images->setOrder(['position']);
     $images->getListXML($imagesNode);
 }