public function getDisplayOptions()
 {
     $aResult = array();
     foreach (NewsletterFrontendModule::$DISPLAY_OPTIONS as $Option) {
         $aResult[$Option] = TranslationPeer::getString('newsletter_config.option.' . $Option, null, StringUtil::makeReadableName($Option));
     }
     return $aResult;
 }
 public function getDisplayOptions()
 {
     $aResult = array();
     foreach (ResourceFinder::findResourceObjectsByExpressions(array(DIRNAME_MODULES, FrontendModule::getType(), FrontendModule::getNameByClassName('LoginFrontendModule'), DIRNAME_TEMPLATES, '/^[\\w_\\d-]+\\.tmpl$/')) as $oResource) {
         $sFileName = $oResource->getFileName('.tmpl');
         if (strpos($sFileName, '_action_') !== false) {
             continue;
         }
         $aResult[$sFileName] = StringUtil::makeReadableName($sFileName);
     }
     return $aResult;
 }
Пример #3
0
 public function getListContents($iRowStart = 0, $iRowCount = null)
 {
     $aResult = array();
     $aInstaller = InstallUtil::loadYamlFile(BASE_DIR . '/' . DIRNAME_MODULES . '/admin/installer/installer_options.yml');
     foreach ($aInstaller['options'] as $sSectionName => $aOptions) {
         $aResult[] = array('action' => $sSectionName, 'title' => TranslationPeer::getString('wns.backup.' . $sSectionName, null, StringUtil::makeReadableName($sSectionName)));
     }
     if ($iRowCount === null) {
         $iRowCount = count($aResult);
     }
     return array_splice($aResult, $iRowStart, $iRowCount);
 }
Пример #4
0
 public static function getDisplayNameByTypeAndName($sType, $sName, $sLanguageId = null)
 {
     $sDisplayName = TranslationPeer::getString("module.{$sType}.{$sName}", $sLanguageId, "");
     if ($sDisplayName === "") {
         $aModuleInfo = self::getModuleInfoByTypeAndName($sType, $sName);
         if (isset($aModuleInfo['name'])) {
             $sDisplayName = $aModuleInfo['name'];
         } else {
             $sDisplayName = StringUtil::makeReadableName($sName);
         }
     }
     return $sDisplayName;
 }
 public function renderBackend()
 {
     $oTemplate = $this->constructTemplate('config');
     // Display options
     $aDisplayOptions = array();
     foreach (self::$DISPLAY_OPTIONS as $sDisplayMode) {
         $aDisplayOptions[$sDisplayMode] = TranslationPeer::getString('journal.display_mode.' . $sDisplayMode, null, StringUtil::makeReadableName($sDisplayMode));
     }
     $oTemplate->replaceIdentifier('display_options', TagWriter::optionsFromArray($aDisplayOptions, null, null, array()));
     // Journal pages and journal options
     $aJournalOptions = array();
     foreach (PageQuery::create()->filterByPageType('journal')->orderByName()->find() as $oPage) {
         $aJournalOptions['page' . self::PAGE_SEPARATOR . $oPage->getId()] = TranslationPeer::getString('wns.journal.journal_page_name', null, null, array('name' => $oPage->getLinkText()));
     }
     foreach (JournalQuery::create()->orderByName()->find() as $oJournal) {
         $aJournalOptions[$oJournal->getId()] = TranslationPeer::getString('wns.journal.journal_name', null, null, array('name' => $oJournal->getName()));
     }
     $oTemplate->replaceIdentifier('journal_options', TagWriter::optionsFromArray($aJournalOptions));
     return $oTemplate;
 }
Пример #6
0
 public function allOptions()
 {
     $aResult = array();
     // Check options
     $aResult['check_options'] = array();
     foreach (self::$CHECK_OPTIONS as $sCheckOption) {
         // no string check required if there is no second language
         if ($sCheckOption === 'strings' && LanguageQuery::create()->count() === 1) {
             continue;
         }
         $aResult['check_options'][$sCheckOption] = TranslationPeer::getString('check_option.' . $sCheckOption, null, StringUtil::makeReadableName($sCheckOption));
     }
     // Directory options, only applicable for static strings
     $aResult['directory_options'] = array();
     foreach (array(DIRNAME_SITE, DIRNAME_PLUGINS, DIRNAME_BASE) as $sDirectory) {
         $aResult['directory_options'][$sDirectory] = StringUtil::makeReadableName($sDirectory);
     }
     $aResult['directory_options'][''] = TranslationPeer::getString('wns.check.all_directories');
     return $aResult;
 }
Пример #7
0
 public function getReadableName()
 {
     return TranslationPeer::getString('tag.' . $this->getName(), null, StringUtil::makeReadableName($this->getName()));
 }
 public function listWidgets()
 {
     $aWidgetTypes = array();
     $aWidgetTypesOrdered = array();
     foreach (get_class_methods($this) as $sMethodName) {
         if (StringUtil::startsWith($sMethodName, 'render') && StringUtil::endsWith($sMethodName, 'Widget')) {
             $oWidget = new StdClass();
             $oWidget->name = StringUtil::deCamelize(substr($sMethodName, strlen('render'), -strlen('Widget')));
             $oWidget->current = in_array($oWidget->name, $this->aWidgets, true);
             $sStringKey = 'journal_config.' . $oWidget->name;
             $oWidget->title = TranslationPeer::getString('journal_config.' . $oWidget->name, null, StringUtil::makeReadableName($oWidget->name));
             if ($oWidget->current) {
                 $iKey = array_search($oWidget->name, $this->aWidgets);
                 if ($iKey !== false) {
                     $aWidgetTypesOrdered[$iKey] = $oWidget;
                 } else {
                     $aWidgetTypes[] = $oWidget;
                 }
             } else {
                 $aWidgetTypes[] = $oWidget;
             }
         }
     }
     ksort($aWidgetTypesOrdered);
     $aWidgetTypes = array_merge($aWidgetTypesOrdered, $aWidgetTypes);
     return $aWidgetTypes;
 }
Пример #9
0
 private function cleanupStyles()
 {
     $aClasses = array();
     if (isset($this->aModuleSettings['classes'])) {
         $aClasses = $this->aModuleSettings['classes'];
         unset($this->aModuleSettings['classes']);
     }
     $aResult = array();
     foreach ($aClasses as $mKey => $sClassName) {
         $sTagName = 'span';
         if (!is_numeric($mKey)) {
             $sTagName = $sClassName;
             $sClassName = $mKey;
         }
         $aResult[] = array('name' => StringUtil::makeReadableName($sClassName), 'element' => $sTagName, 'attributes' => array('class' => $sClassName));
     }
     if (count($aResult) == 0) {
         $this->setSetting('stylesSet', 'default');
     } else {
         $this->setSetting('stylesSet', $aResult);
     }
 }
Пример #10
0
 /**
  * getAvailablePageProperties()
  *
  * description:
  * - gets instances of 'pageProperty' with default values in template and fills the stored page related properties if exist
  * - called at page_detail.load_page @see getPageData()
  * @return mixed null/hash of page_properties
  */
 private function getAvailablePageProperties($oPage)
 {
     $aAvailablePageProperties = $oPage->getTemplate()->identifiersMatching('pageProperty', Template::$ANY_VALUE);
     $aResult = array();
     $aSetProperties = array();
     foreach ($oPage->getPagePropertyQuery()->byNamespace(false)->find() as $oPageProperty) {
         $aSetProperties[$oPageProperty->getName()] = $oPageProperty->getValue();
     }
     foreach ($aAvailablePageProperties as $oProperty) {
         $sPropertyName = $oProperty->getValue();
         $aResult[$sPropertyName]['value'] = isset($aSetProperties[$sPropertyName]) ? $aSetProperties[$sPropertyName] : '';
         $aResult[$sPropertyName]['defaultValue'] = $oProperty->getParameter('defaultValue');
         $aResult[$sPropertyName]['type'] = $oProperty->getParameter('propertyType');
         unset($aSetProperties[$sPropertyName]);
     }
     foreach ($aSetProperties as $sRemainingPropertyName => $sRemainingPropertyValue) {
         $aResult[$sRemainingPropertyName] = array('value' => $sRemainingPropertyValue, 'defaultValue' => null, 'type' => null);
     }
     $aResult['page_identifier'] = array('value' => $oPage->getIdentifier(), 'defaultValue' => null, 'type' => null);
     foreach ($aResult as $sName => &$aValues) {
         $aValues['display_name'] = TranslationPeer::getString("page_property.{$sName}", null, StringUtil::makeReadableName($sName));
     }
     return $aResult;
 }