public function __construct($sSessionId)
 {
     parent::__construct($sSessionId);
     $oRichtext = WidgetModule::getWidget('rich_text', null, null, 'documentation');
     $oRichtext->setTemplate(PagePeer::getRootPage()->getTemplate());
     $this->setSetting('richtext_session', $oRichtext->getSessionKey());
     $this->setSetting('international_option', LanguageInputWidgetModule::isMonolingual());
 }
 public function getWidget()
 {
     $oRichTextWidget = WidgetModule::getWidget('rich_text', null, $this->widgetData(), 'admin');
     $aToolbarSettings = Settings::getSetting('text_module', 'toolbar', null);
     $oRichTextWidget->setSetting('contentsLanguage', $this->oLanguageObject->getLanguageId());
     $oGenericWidget = WidgetModule::getWidget('generic_frontend_module', null, $this, $oRichTextWidget);
     $oGenericWidget->setSetting('preferred_width', $oRichTextWidget->getSettings('richtext_width', 600));
     return $oGenericWidget;
 }
 protected function createListWidget()
 {
     $oListWidget = new ListWidgetModule();
     $this->oDelegateProxy = new CriteriaListWidgetDelegate($this, "LinkCategory", 'name');
     $oListWidget->setDelegate($this->oDelegateProxy);
     $this->oExternallyManagedInputFilter = WidgetModule::getWidget('externally_managed_input', true);
     $this->oDelegateProxy->setInternallyManagedOnly(true);
     return $oListWidget;
 }
 protected function createListWidget()
 {
     $oListWidget = new ListWidgetModule();
     $this->oDelegateProxy = new CriteriaListWidgetDelegate($this, "User", 'full_name');
     $oListWidget->setDelegate($this->oDelegateProxy);
     $oListWidget->setSetting('row_model_drag_and_drop_identifier', 'id');
     $this->oDelegateProxy->setUserKind(CriteriaListWidgetDelegate::SELECT_ALL);
     $this->oUserKindFilter = WidgetModule::getWidget('user_kind_input', null, $this->oDelegateProxy->getUserKind());
     return $oListWidget;
 }
 protected function createListWidget()
 {
     $oListWidget = new ListWidgetModule();
     $this->oDelegateProxy = new CriteriaListWidgetDelegate($this, "Newsletter", 'updated_at', 'desc');
     $oListWidget->setDelegate($this->oDelegateProxy);
     if (!LanguageInputWidgetModule::isMonolingual()) {
         $this->oLanguageFilter = WidgetModule::getWidget('language_input', null, true);
     }
     return $oListWidget;
 }
 protected function createListWidget()
 {
     $oListWidget = new ListWidgetModule();
     $this->oDelegateProxy = new CriteriaListWidgetDelegate($this, "JournalEntry", "publish_at", "desc");
     $oListWidget->setDelegate($this->oDelegateProxy);
     $oListWidget->setSetting('row_model_drag_and_drop_identifier', 'id');
     $this->oTagFilter = WidgetModule::getWidget('tag_input', null, true);
     $this->oTagFilter->setSetting('model_name', 'JournalEntry');
     return $oListWidget;
 }
 private function content(Template $oTemplate, $sWidgetName)
 {
     $sWidgetClass = WidgetModule::getClassNameByName($sWidgetName);
     if (is_callable(array($sWidgetClass, 'testWidget'))) {
         $oWidget = $sWidgetClass::testWidget();
     } else {
         $oWidget = WidgetModule::getWidget($sWidgetName, null);
     }
     $oTemplate->replaceIdentifierMultiple('main_content', $oWidget->doWidget());
 }
 public function __construct($sSessionKey = null)
 {
     parent::__construct($sSessionKey);
     $oRichtextWidget = WidgetModule::getWidget('rich_text', null, '', 'newsletter');
     $oNewsletterPage = PageQuery::create()->findOneByIdentifier('newsletter');
     if ($oNewsletterPage) {
         $oRichtextWidget->setTemplate($oNewsletterPage->getTemplate());
     }
     $this->setSetting('rich_text_session', $oRichtextWidget->getSessionKey());
 }
 public function __construct($sSessionId)
 {
     parent::__construct($sSessionId);
     $iDocumentationPartCategory = 2;
     if (DocumentCategoryQuery::create()->filterById($iDocumentationPartCategory)->count() === 0) {
         throw new Exception(__METHOD__ . ': Please setup the exernally managed document category for this module');
     }
     $this->setSetting('documentation_image_category_id', $iDocumentationPartCategory);
     $oRichtext = WidgetModule::getWidget('rich_text', null, null, 'documentation_part');
     $oRichtext->setTemplate(PagePeer::getRootPage()->getTemplate());
     $this->setSetting('richtext_session', $oRichtext->getSessionKey());
 }
 protected function createListWidget()
 {
     $oListWidget = new ListWidgetModule();
     $this->oDelegateProxy = new CriteriaListWidgetDelegate($this, "Link", "name_truncated", "asc");
     $oListWidget->setDelegate($this->oDelegateProxy);
     $oListWidget->setSetting('row_model_drag_and_drop_identifier', 'id');
     if (!LanguageInputWidgetModule::isMonolingual()) {
         $this->oLanguageFilter = WidgetModule::getWidget('language_input', null, true);
     }
     $this->oTagFilter = WidgetModule::getWidget('tag_input', null, true);
     $this->oTagFilter->setSetting('model_name', 'Link');
     return $oListWidget;
 }
 public function __construct($sSessionKey = null, $oPage = null)
 {
     parent::__construct($sSessionKey);
     $this->oRichTextWidget = WidgetModule::getWidget('rich_text', null, null, 'journal');
     if ($oPage === null) {
         // get any blog page in site
         $oPage = PageQuery::create()->filterByPageType('journal')->joinPageProperty()->useQuery('PageProperty')->filterByName('journal:journal_id')->endUse()->findOne();
     }
     if ($oPage) {
         $this->oRichTextWidget->setTemplate($oPage->getTemplateNameUsed());
     }
     $this->setSetting('richtext_session', $this->oRichTextWidget->getSessionKey());
     $iJournalEntryImageCategory = Settings::getSetting('journal', 'externally_managed_images_category', null);
     $this->setSetting('journal_entry_images_category_id', $iJournalEntryImageCategory);
     $this->setSetting('date_today', date('d.m.Y'));
     $this->setSetting('date_format', 'dd.mm.yy');
 }
Exemple #12
0
 public function __construct($bShouldLogin = true)
 {
     parent::__construct();
     SanityCheck::basicCheck();
     if ($bShouldLogin && (!Session::getSession()->isAuthenticated() || !Session::getSession()->getUser()->getIsBackendLoginEnabled())) {
         LinkUtil::redirect(LinkUtil::link(array(), 'AdminManager', array('preview' => self::getRequestedPath())));
     }
     $oResourceIncluder = ResourceIncluder::defaultIncluder();
     $oResourceIncluder->addCustomJs('window.FILE_PREFIX = "' . MAIN_DIR_FE_PHP . Manager::getPrefixForManager('FileManager') . '";');
     //Fix JSON requests when using Prototype in the frontend
     $oResourceIncluder->addReverseDependency('lib_prototype', false, 'preview/prototype_json_fix.js');
     //Add jQuery and jQuery UI
     $oResourceIncluder->addJavaScriptLibrary('jquery', AdminManager::JQUERY_VERSION, null, true, null, ResourceIncluder::PRIORITY_FIRST);
     $oResourceIncluder->addJavaScriptLibrary('jqueryui', AdminManager::JQUERY_UI_VERSION);
     //Add client widget handling code
     $oResourceIncluder->addResource('widget/widget.js');
     $oResourceIncluder->addResource('widget/widget_skeleton.js');
     //Provides some basic overrides for tooltip, notifyuser and stuff
     //Override some site styles in specific regions
     $oResourceIncluder->addResource('preview/preview-reset.css');
     $oResourceIncluder->addResource('preview/preview-default.css');
     $oResourceIncluder->addResource('admin/theme/jquery-ui-1.10.2.custom.min.css');
     //Add the css that handles styles for all widgets but namespace it so it applies only to specific areas of the page (editable areas, dialogs, the admin menu, etc.)
     $this->addNamespacedCss(array('widget', 'widget.css'));
     $oResourceIncluder->addResource('backend/additions.js', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     $oResourceIncluder->addResource('preview/additions.js', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     $oResourceIncluder->addResource('backend/additions.css', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     $oResourceIncluder->addResource('preview/additions.css', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     //preview-interface.css contains things like the edit buttons
     ResourceIncluder::defaultIncluder()->addResource('preview-interface.css', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     //Include the resources of widgets we know we’re gonna use.
     if ($bShouldLogin) {
         $oLoginWindowWidget = WidgetModule::getWidget('login_window');
         LoginWindowWidgetModule::includeResources();
     }
     $this->oAdminMenuWidget = WidgetModule::getWidget('admin_menu');
     AdminMenuWidgetModule::includeResources();
     $this->oPageTypeWidget = WidgetModule::getWidget('page_type');
     PageTypeWidgetModule::includeResources();
 }
Exemple #13
0
 public function getAdminWidget()
 {
     return WidgetModule::getWidget('language_object_control', null, $this, FrontendModule::getModuleInstance($this->getContentObject()->getObjectType(), $this));
 }
Exemple #14
0
 /**
  * Returns the widget used to configure this particular frontend module. Default implementation outputs the contents of renderBackend as form and serializes that on save. If renderBackend returns a falsish value, the default widget is the one that’s named the same as this frontend module plus a suffix of “_frontend_config” and whose constructor, in addition to the session key, takes but one argument: the frontend module instance $this.
  * @return WidgetModule|string The configured widget or its bare name
  */
 public function getWidget()
 {
     $oBackend = $this->renderBackend();
     if ($oBackend) {
         return WidgetModule::getWidget("generic_frontend_module", null, $this, $this->renderBackend());
     }
     return WidgetModule::getWidget($this->getModuleName() . '_frontend_config', null, $this);
 }
 public function adminEdit($iObjectId, $sLanguageId = null)
 {
     if ($sLanguageId !== null) {
         $this->sLanguageId = $sLanguageId;
     }
     if ($this->sLanguageId === null) {
         $this->sLanguageId = AdminManager::getContentLanguage();
     }
     $oCurrentContentObject = $this->contentObjectById($iObjectId);
     $oCurrentLanguageObject = $oCurrentContentObject->getLanguageObject($this->sLanguageId);
     if ($oCurrentLanguageObject === null) {
         $oCurrentLanguageObject = new LanguageObject();
         $oCurrentLanguageObject->setLanguageId($this->sLanguageId);
         $oCurrentLanguageObject->setContentObject($oCurrentContentObject);
         $oCurrentLanguageObject->setData(null);
     }
     $oModuleInstance = $this->backendModuleInstanceByLanguageObject($oCurrentLanguageObject);
     $oWidget = WidgetModule::getWidget('language_object_control', null, $oCurrentLanguageObject, $oModuleInstance);
     $oResult = new stdClass();
     $oResult->control_session_key = $oWidget->getSessionKey();
     $oResult->type = $oCurrentContentObject->getObjectType();
     return $oResult;
 }
 public function __construct($sSessionKey = null)
 {
     parent::__construct($sSessionKey);
     $oPopover = WidgetModule::getWidget('popover', null, $this);
     $this->setSetting('popover', $oPopover->getSessionKey());
 }
 public function __construct()
 {
     $this->oChooserList = WidgetModule::getWidget('list');
     $this->oChooserList->setDelegate($this);
     $this->addResourceParameter(ResourceIncluder::RESOURCE_TYPE_JS, 'chooser', $this->oChooserList->getSessionKey());
 }
 public function detailWidget()
 {
     $oWidget = WidgetModule::getWidget('journal_entry_detail', null, $this->oPage);
     return $oWidget->getSessionKey();
 }