本文整理汇总了PHP中StringUtil::makeReadableName方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil::makeReadableName方法的具体用法?PHP StringUtil::makeReadableName怎么用?PHP StringUtil::makeReadableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringUtil
的用法示例。
在下文中一共展示了StringUtil::makeReadableName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDisplayOptions
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;
}
示例2: getDisplayOptions
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: getListContents
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: getDisplayNameByTypeAndName
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;
}
示例5: renderBackend
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: allOptions
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: getReadableName
public function getReadableName()
{
return TranslationPeer::getString('tag.' . $this->getName(), null, StringUtil::makeReadableName($this->getName()));
}
示例8: listWidgets
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: cleanupStyles
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: getAvailablePageProperties
/**
* 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;
}