/** * @param \Difra\Param\AnyInt $id */ public function pageAction(Param\AnyInt $id) { /** @var $pageNode \DOMElement */ $pageNode = $this->root->appendChild($this->xml->createElement('page')); $page = Page::get($id->val()); $page->getXML($pageNode); $this->root->setAttribute('pageTitle', $page->getTitle()); }
public function editAction(\Difra\Param\AnyInt $id) { $rootNode = $this->root->appendChild($this->xml->createElement('FP_editform')); $formNode = $rootNode->appendChild($this->xml->createElement('form')); if (!\Difra\Plugins\FormProcessor::getInstance()->getFormXML($formNode, $id->val())) { $this->view->httpError(404); } }
public function editAction(\Difra\Param\AnyInt $id) { $editNode = $this->root->appendChild($this->xml->createElement('announcementsEdit')); \Difra\Plugins\Announcements::getInstance()->getByIdXML($id->val(), $editNode); if (\Difra\Plugger::getInstance()->isEnabled('blogs')) { \Difra\Plugins\Blogs\Group::getNewGroupsXml($editNode, 0, false); } }
public function deleteaddedAjaxAction(\Difra\Param\AnyInt $id) { $Locale = \Difra\Locales::getInstance(); if (\Difra\Plugins\videoManager::getInstance()->deleteAddedVideo($id->val())) { $this->ajax->display($Locale->getXPath('videoManager/adm/notify/videoDeleted') . '<br/><br/><a class="button" href="#" onclick="window.location.reload();">' . $Locale->getXPath('videoManager/adm/close') . '</a>'); } else { $this->ajax->display($Locale->getXPath('videoManager/adm/errors/noDelete') . '<br/><br/><a class="button" href="#" onclick="window.location.reload();">' . $Locale->getXPath('videoManager/adm/close') . '</a>'); } }
public function deleteAjaxAction(\Difra\Param\AnyInt $id, \Difra\Param\AjaxCheckbox $confirm = null) { if (!$confirm or !$confirm->val()) { $ext = \Difra\Plugins\Catalog\Ext::get($id->val()); $this->ajax->display('<span>' . $this->locale->getXPath('catalog/adm/ext/delete-confirm-1') . htmlspecialchars($ext->getName()) . $this->locale->getXPath('catalog/adm/ext/delete-confirm-2') . '</span>' . '<form action="/adm/catalog/ext/delete/' . $id . '" method="post" class="ajaxer">' . '<input type="hidden" name="confirm" value="1"/>' . '<input type="submit" value="Да"/>' . '<a href="#" onclick="ajaxer.close(this)" class="button">Нет</a>' . '</form>'); } else { \Difra\Plugins\Catalog\Ext::get($id->val())->delete(); $this->ajax->refresh(); } }
/** * View image * @param Difra\Param\AnyInt $id * @throws Difra\View\HttpError */ public function tmpAction(\Difra\Param\AnyInt $id) { $data = \Difra\Libs\Vault::get($id->val()); if (!$data) { throw new \Difra\View\HttpError(404); } \Difra\View::$rendered = true; header('Content-type: image/png'); echo $data; }
public function editAction(\Difra\Param\AnyInt $newsId) { $node = $this->root->appendChild($this->xml->createElement('publication-edit')); $Pub = \Difra\Plugins\News\Publication::getById($newsId->val()); if ($Pub) { $Pub->getXML($node); } else { $this->view->httpError(404); } }
/** * Delete page * @param \Difra\Param\AnyInt $id * @param \Difra\Param\AjaxCheckbox $confirm */ public function deleteAjaxAction(\Difra\Param\AnyInt $id, \Difra\Param\AjaxCheckbox $confirm = null) { if ($confirm and $confirm->val()) { \Difra\Plugins\CMS\Page::get($id->val())->delete(); Ajaxer::close(); Ajaxer::redirect('/adm/content/pages'); return; } $page = \Difra\Plugins\CMS\Page::get($id->val()); Ajaxer::display('<span>' . \Difra\Locales::get('cms/adm/delete-page-confirm-1') . $page->getTitle() . \Difra\Locales::get('cms/adm/delete-page-confirm-2') . '</span>' . '<form action="/adm/content/pages/delete/' . $id . '" method="post" class="ajaxer">' . '<input type="hidden" name="confirm" value="1"/>' . '<input type="submit" value="Да"/>' . '<a href="#" onclick="ajaxer.close(this)" class="button">Нет</a>' . '</form>'); }
public function editAction(\Difra\Param\AnyInt $id) { /** @var \DOMElement $editNode */ $editNode = $this->root->appendChild($this->xml->createElement('CatalogItemEdit')); \Difra\Plugins\Catalog::getInstance()->getCategoriesListXML($editNode); \Difra\Plugins\Catalog\Ext::getListXML($editNode, true, true); $itemNode = $editNode->appendChild($this->xml->createElement('item')); $item = \Difra\Plugins\Catalog\Item::get($id->val()); $item->loadExt(); $item->getXML($itemNode); $editNode->setAttribute('category', $item->getCategory()); }
/** * @param \Difra\Param\AnyInt $id * @param \Difra\Param\AjaxInt $confirm */ public function delAjaxAction(\Difra\Param\AnyInt $id, \Difra\Param\AjaxInt $confirm = null) { if (!($snippet = \Difra\Plugins\CMS\Snippet::getById($id->val()))) { \Difra\Ajaxer::redirect('/adm/cms/snippets'); } if (!$confirm) { \Difra\Ajaxer::confirm(\Difra\Locales::get('cms/adm/snippet/del-confirm1') . $snippet->getName() . \Difra\Locales::get('cms/adm/snippet/del-confirm2')); return; } $snippet->del(); \Difra\Ajaxer::close(); \Difra\Ajaxer::redirect('/adm/content/snippets'); }
public function indexAction(\Difra\Param\AnyInt $id) { /** @var \DOMElement $albumNode */ $albumNode = $this->root->appendChild($this->xml->createElement('GalleryAlbumView')); $album = \Difra\Plugins\Gallery\Album::get($id->val()); if (!$album->load()) { throw new \Difra\View\HttpError(404); } $album->getXML($albumNode); $albumNode->setAttribute('id', $id); $sizesNode = $albumNode->appendChild($this->xml->createElement('sizes')); $album->getSizesXML($sizesNode); }
public function editAction(\Difra\Param\AnyInt $id) { $editNode = $this->root->appendChild($this->xml->createElement('announcementsEdit')); \Difra\Plugins\Announcements::getInstance()->getByIdXML($id->val(), $editNode); $additionalsFieldsNode = $editNode->appendChild($this->xml->createElement('additionalsFields')); $categoryNode = $editNode->appendChild($this->xml->createElement('announceCateroty')); \Difra\Plugins\Announcements\Additionals::getListXML($additionalsFieldsNode); \Difra\Plugins\Announcements\Category::getList($categoryNode); $locationsNode = $editNode->appendChild($this->xml->createElement('locations')); \Difra\Plugins\Announcements::getInstance()->getLocationsXML($locationsNode); if (\Difra\Plugger::isEnabled('blogs')) { \Difra\Plugins\Blogs\Group::getNewGroupsXml($editNode, 0, false); } }
/** * This action handles rewrites from nginx for URLs like: * /sitemap.xml * /sitemap-1.xml * /sitemap-2.xml * etc. * * @param Difra\Param\AnyInt $page * @throws Difra\View\HttpError */ public function indexAction(\Difra\Param\AnyInt $page = null) { $this->cache = self::CACHE_TTL; if (!$page) { $this->outputType = 'text/xml'; $this->output = \Difra\Libs\XML\Sitemap::getXML(); } else { $res = \Difra\Libs\XML\Sitemap::getXML($page->val()); if (!$res) { throw new \Difra\View\HttpError(404); } $this->outputType = 'text/xml'; $this->output = $res; } }
public function downAjaxAction(\Difra\Param\AnyInt $id) { \Difra\Plugins\Catalog::getInstance()->moveCategoryDown($id->val()); $this->ajax->refresh(); }
public function deleteAction(\Difra\Param\AnyInt $id) { \Difra\Plugins\Announcements\Additionals::delete($id->val()); \Difra\Ajaxer::getInstance()->refresh(); }
/** * Manual user activation * @param Param\AnyInt $id */ public function activateAjaxAction(Param\AnyInt $id) { User::getById($id->val())->activateManual(); Ajaxer::refresh(); }
public function downAjaxAction(\Difra\Param\AnyInt $id) { \Difra\Plugins\Gallery::getInstance()->albumDown($id->val()); $this->ajax->redirect('/adm/gallery/albums/'); }
public function deleteAjaxAction(Param\AnyString $module, Param\AnyInt $commentId) { \Difra\Plugins\Comments\Comment::delete($commentId->val(), $module->val()); $this->ajax->refresh(); }
public function deletealiasAjaxAction(\Difra\Param\AnyInt $aliasId) { \Difra\Plugins\Tags::getInstance()->deleteAlias($aliasId->val()); \Difra\Libs\Cookies::getInstance()->notify(\Difra\Locales::getInstance()->getXPath('tags/adm/aliasDeleted')); $this->ajax->reload(); }
public function deleteAjaxAction(\Difra\Param\AnyInt $id) { \Difra\Plugins\Announcements\Category::delete($id->val()); $this->ajax->refresh(); }
/** * Move menu element down * @param Difra\Param\AnyInt $id */ public function downAjaxAction(\Difra\Param\AnyInt $id) { \Difra\Plugins\CMS\MenuItem::get($id->val())->moveDown(); \Difra\Ajaxer::refresh(); }
public function editAction(\Difra\Param\AnyInt $id) { $LocNode = $this->root->appendChild($this->xml->createElement('announcementsLocationsEdit')); $LocNode->setAttribute('id', $id->val()); \Difra\Plugins\Announcements::getInstance()->getLocationByIdXML($id->val(), $LocNode); }
public function deleteimageAjaxAction(\Difra\Param\AnyInt $id) { \Difra\Plugins\Portfolio::deleteImage($id->val()); $this->ajax->refresh(); }
public function editAjaxAction(\Difra\Param\AjaxString $host, \Difra\Param\AjaxInt $port, \Difra\Param\AnyInt $id) { \Difra\Plugins\CDN::getInstance()->saveHost($id->val(), $host->val(), $port->val()); $this->ajax->display(\Difra\Locales::getInstance()->getXPath('cdn/adm/notify/saved') . '<div><a href="#" class="button" onclick="window.location = \'/adm/cdn/hosts\';">' . \Difra\Locales::getInstance()->getXPath('cdn/adm/close') . '</a></div>'); }
public function formAction(\Difra\Param\AnyInt $id) { $formViewXml = $this->root->appendChild($this->xml->createElement('fp_viewform')); \Difra\Plugins\FormProcessor::getInstance()->getFormXML($formViewXml, $id->val()); }