当前位置: 首页>>代码示例>>PHP>>正文


PHP Resource::getCurrentTheme方法代码示例

本文整理汇总了PHP中Resource::getCurrentTheme方法的典型用法代码示例。如果您正苦于以下问题:PHP Resource::getCurrentTheme方法的具体用法?PHP Resource::getCurrentTheme怎么用?PHP Resource::getCurrentTheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Resource的用法示例。


在下文中一共展示了Resource::getCurrentTheme方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderList

 protected function renderList()
 {
     if ($this->m_FormPrefix) {
         $formNameStr = str_replace(".", "_", $this->getFormObj()->m_Name) . "_";
     }
     $onchange_func = $this->getOnChangeFunction();
     $list = $this->getList();
     if ($this->m_BlankOption) {
         $entry = explode(",", $this->m_BlankOption);
         $text = $entry[0];
         $value = $entry[1] != "" ? $entry[1] : null;
         $entryList = array(array("val" => $value, "txt" => $text));
         $list = array_merge($entryList, $list);
     }
     $value = $this->m_Value ? $this->m_Value : $this->getText();
     $sHTML = "<div  class=\"dropdownlist\"  id=\"" . $formNameStr . $this->m_Name . "_scroll\" style=\"display:none;\">" . ($sHTML .= "<ul style=\"display:none;z-index:50\" id=\"" . $formNameStr . $this->m_Name . "_list\">");
     $theme = Resource::getCurrentTheme();
     $image_url = THEME_URL . "/" . $theme . "/images";
     foreach ($list as $item) {
         $val = $item['val'];
         $txt = $item['txt'];
         $pic = $item['pic'];
         if ($pic != "") {
             $str_pic = "<img src='" . $image_url . "/spacer.gif' style='background-color:#{$pic};width:12px;height:12px;padding-top:0px;margin-top:3px;' />";
         } else {
             $str_pic = "";
         }
         if (!preg_match("/</si", $txt)) {
             $display_value = $txt;
         } else {
             $display_value = $val;
         }
         if ($str_pic) {
             $li_option_value = $str_pic . "<span>" . $txt . "</span>";
         } else {
             $li_option_value = $txt;
         }
         if ($val == $value) {
             $option_item_style = " class='selected' ";
         } else {
             $option_item_style = " onmouseover=\"this.className='hover'\" onmouseout=\"this.className=''\" ";
         }
         $sHTML .= "<li {$option_item_style}\t\n\t\t\t\tonclick=\"\$('" . $formNameStr . $this->m_Name . "_list').hide();\n\t\t\t\t\t\t\t\$('" . $formNameStr . $this->m_Name . "_scroll').hide();\n\t\t\t\t\t\t\t\$('" . $formNameStr . $this->m_Name . "').setValue('" . addslashes($display_value) . "');\n\t\t\t\t\t\t\t\$('" . $formNameStr . $this->m_Name . "_hidden').setValue('" . addslashes($val) . "');\n\t\t\t\t\t\t\t\$('span_" . $formNameStr . $this->m_Name . "').innerHTML = this.innerHTML;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{$onchange_func} ;\n\t\t\t\t\t\t\t\$('" . $formNameStr . $this->m_Name . "').className='" . $this->m_cssClass . "'\n\t\t\t\t\t\t\t\"\t\t\t\t\t\n\t\t\t\t>{$li_option_value}</li>";
         if ($val == $value) {
             $this->m_DefaultDisplayValue = "" . $str_pic . "<span>" . $txt . "</span>";
         }
     }
     $sHTML .= "</ul>";
     $sHTML .= "</div>";
     return $sHTML;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:51,代码来源:TypeSelector.php

示例2: getTplFileWithPath

 /**
  * Get openbiz template file path by searching modules/package, /templates
  *
  * @param string $className
  * @return string php library file path
  * */
 public static function getTplFileWithPath($templateFile, $packageName)
 {
     //for not changing a lot things, the best injection point is added theme support here.
     $theme = Resource::getCurrentTheme();
     $themePath = $theme;
     // BizSystem::configuration()->GetThemePath($theme);
     if ($themePath) {
         $templateRoot = THEME_PATH . "/" . $themePath . "/template";
     } else {
         $templateRoot = SMARTY_TPL_PATH;
     }
     $names = explode(".", $packageName);
     if (count($names) > 0) {
         $moduleName = $names[0];
     }
     $packagePath = str_replace('.', '/', $packageName);
     // check the leading char '@'
     $checkExtModule = true;
     if (strpos($packagePath, '@') === 0) {
         $packagePath = substr($packagePath, 1);
         $checkExtModule = false;
     }
     $searchTpls = array(MODULE_PATH . "/{$packagePath}/template/{$templateFile}", dirname(MODULE_PATH . "/{$packagePath}") . "/template/{$templateFile}", MODULE_PATH . "/{$moduleName}/template/{$templateFile}", $templateRoot . "/{$templateFile}");
     if ($checkExtModule && defined('MODULE_EX_PATH')) {
         array_unshift($searchTpls, MODULE_EX_PATH . "/{$packagePath}/template/{$templateFile}");
     }
     // device
     if (defined('CLIENT_DEVICE')) {
         array_unshift($searchTpls, MODULE_PATH . "/{$moduleName}/template/" . CLIENT_DEVICE . "/{$templateFile}");
     }
     foreach ($searchTpls as $tplFile) {
         if (file_exists($tplFile)) {
             return $tplFile;
         }
     }
     $errmsg = BizSystem::getMessage("UNABLE_TO_LOCATE_TEMPLATE_FILE", array($templateFile));
     trigger_error($errmsg, E_USER_ERROR);
     return null;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:45,代码来源:Resource.php

示例3: outputAttrs

 /**
  * Get output attributs as array
  *
  * @return array array of attributs
  * @todo rename to getOutputAttribute or getAttribute (2.5?)
  */
 public function outputAttrs()
 {
     $output['name'] = $this->m_Name;
     $output['dataService'] = $this->m_DataService;
     $output['queryString'] = $this->m_QueryString;
     $output['title'] = Expression::evaluateExpression($this->m_Title, $this);
     $output['icon'] = $this->m_Icon;
     $output['hasSubform'] = $this->m_SubForms ? 1 : 0;
     $output['currentPage'] = $this->m_CurrentPage;
     $output['currentRecordId'] = $this->m_RecordId;
     $output['totalPages'] = $this->m_TotalPages;
     $output['totalRecords'] = $this->m_TotalRecords;
     $output['description'] = str_replace('\\n', "<br />", Expression::evaluateExpression($this->m_Description, $this));
     $output['elementSets'] = $this->getElementSet();
     $output['tabSets'] = $this->getTabSet();
     $output['ActionElementSets'] = $this->getElementSet($this->m_ActionPanel);
     if ($output['icon']) {
         if (preg_match("/{.*}/si", $output['icon'])) {
             $output['icon'] = Expression::evaluateExpression($output['icon'], null);
         } else {
             $output['icon'] = THEME_URL . "/" . Resource::getCurrentTheme() . "/images/" . $output['icon'];
         }
     }
     return $output;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:31,代码来源:EasyForm.php


注:本文中的Resource::getCurrentTheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。