mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-20 19:02:14 +09:00
Add site subtitle
This commit is contained in:
parent
49a42abddb
commit
e90f60de22
7 changed files with 71 additions and 28 deletions
|
|
@ -810,24 +810,46 @@ class Context
|
|||
}
|
||||
|
||||
/**
|
||||
* Add string to browser title
|
||||
* Append string to browser title
|
||||
*
|
||||
* @param string $site_title Browser title to be added
|
||||
* @param string $site_title Browser title to be appended
|
||||
* @return void
|
||||
*/
|
||||
public static function addBrowserTitle($site_title)
|
||||
public static function addBrowserTitle($title)
|
||||
{
|
||||
if(!$site_title)
|
||||
if(!$title)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(self::$_instance->site_title)
|
||||
{
|
||||
self::$_instance->site_title .= ' - ' . $site_title;
|
||||
self::$_instance->site_title .= ' - ' . $title;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_instance->site_title = $site_title;
|
||||
self::$_instance->site_title = $title;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepend string to browser title
|
||||
*
|
||||
* @param string $site_title Browser title to be prepended
|
||||
* @return void
|
||||
*/
|
||||
public static function prependBrowserTitle($title)
|
||||
{
|
||||
if(!$title)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(self::$_instance->site_title)
|
||||
{
|
||||
self::$_instance->site_title = $title . ' - ' . self::$_instance->site_title;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_instance->site_title = $title;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -837,13 +859,13 @@ class Context
|
|||
* @param string $site_title Browser title to be set
|
||||
* @return void
|
||||
*/
|
||||
public static function setBrowserTitle($site_title)
|
||||
public static function setBrowserTitle($title)
|
||||
{
|
||||
if(!$site_title)
|
||||
if(!$title)
|
||||
{
|
||||
return;
|
||||
}
|
||||
self::$_instance->site_title = $site_title;
|
||||
self::$_instance->site_title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -860,19 +882,25 @@ class Context
|
|||
}
|
||||
|
||||
/**
|
||||
* Return layout's title
|
||||
* @return string layout's title
|
||||
* Return site title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getSiteTitle()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$moduleConfig = $oModuleModel->getModuleConfig('module');
|
||||
|
||||
if(isset($moduleConfig->siteTitle))
|
||||
{
|
||||
return $moduleConfig->siteTitle;
|
||||
}
|
||||
return '';
|
||||
$moduleConfig = getModel('module')->getModuleConfig('module');
|
||||
return isset($moduleConfig->siteTitle) ? trim($moduleConfig->siteTitle) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return site subtitle
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getSiteSubtitle()
|
||||
{
|
||||
$moduleConfig = getModel('module')->getModuleConfig('module');
|
||||
return isset($moduleConfig->siteSubtitle) ? trim($moduleConfig->siteSubtitle) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -285,7 +285,16 @@ class ModuleHandler extends Handler
|
|||
$this->module = $module_info->module;
|
||||
$this->mid = $module_info->mid;
|
||||
$this->module_info = $module_info;
|
||||
Context::setBrowserTitle($module_info->browser_title);
|
||||
if ($module_info->mid == $site_module_info->mid)
|
||||
{
|
||||
Context::setBrowserTitle(Context::getSiteTitle());
|
||||
Context::addBrowserTitle(Context::getSiteSubtitle());
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::setBrowserTitle(Context::getSiteTitle());
|
||||
Context::addBrowserTitle($module_info->browser_title);
|
||||
}
|
||||
|
||||
$viewType = (Mobile::isFromMobilePhone()) ? 'M' : 'P';
|
||||
$targetSrl = (Mobile::isFromMobilePhone()) ? 'mlayout_srl' : 'layout_srl';
|
||||
|
|
|
|||
|
|
@ -511,6 +511,7 @@ class adminAdminController extends admin
|
|||
// Site title and HTML footer
|
||||
$args = new stdClass;
|
||||
$args->siteTitle = $vars->site_title;
|
||||
$args->siteSubtitle = $vars->site_subtitle;
|
||||
$args->htmlFooter = $vars->html_footer;
|
||||
$oModuleController->updateModuleConfig('module', $args);
|
||||
|
||||
|
|
|
|||
|
|
@ -417,6 +417,7 @@ class adminAdminView extends admin
|
|||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('module');
|
||||
Context::set('site_title', escape($config->siteTitle));
|
||||
Context::set('site_subtitle', escape($config->siteSubtitle));
|
||||
Context::set('all_html_footer', escape($config->htmlFooter));
|
||||
|
||||
// Index module
|
||||
|
|
|
|||
|
|
@ -15,10 +15,9 @@ $lang->favorites = 'Favorites';
|
|||
$lang->admin_info = 'Administrator Info';
|
||||
$lang->admin_index = 'Index Admin Page';
|
||||
$lang->control_panel = 'Dashboard';
|
||||
$lang->site_title = 'Site title';
|
||||
$lang->site_title = 'Site Title';
|
||||
$lang->site_title = 'Site Subtitle';
|
||||
$lang->start_module = 'Homepage';
|
||||
$lang->about_site_title = 'This is the title which is exposed when the site title is not set at detail setting.';
|
||||
$lang->about_start_module = 'You can specify the default page for the site.';
|
||||
$lang->select_site = 'Site';
|
||||
$lang->select_module_type = 'Module Type';
|
||||
$lang->select_module_instance = 'Select Page';
|
||||
|
|
|
|||
|
|
@ -16,9 +16,8 @@ $lang->admin_info = '관리자 정보';
|
|||
$lang->admin_index = '관리자 초기 페이지';
|
||||
$lang->control_panel = '대시보드';
|
||||
$lang->site_title = '사이트 제목';
|
||||
$lang->start_module = '홈페이지';
|
||||
$lang->about_site_title = '세부 설정에서 사이트제목을 설정하지 않았을 경우 노출되는 제목입니다.';
|
||||
$lang->about_start_module = '사이트 접속 시 기본으로 호출될 페이지 지정할 수 있습니다.';
|
||||
$lang->site_subtitle = '사이트 부제목';
|
||||
$lang->start_module = '메인화면 모듈 선택';
|
||||
$lang->select_site = '사이트 선택';
|
||||
$lang->select_module_type = '분류 선택';
|
||||
$lang->select_module_instance = '페이지 선택';
|
||||
|
|
|
|||
|
|
@ -11,13 +11,19 @@
|
|||
</form>
|
||||
<div class="x_form-horizontal" id="admin_config">
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->site_title} <a class="x_icon-question-sign" href="./common/manual/admin/index.html#UMAN_config_general_site_title" target="_blank">{$lang->help}</a></label>
|
||||
<label class="x_control-label">{$lang->site_title}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" name="site_title" value="{$site_title}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="_target_module">{$lang->start_module} <a class="x_icon-question-sign" href="./common/manual/admin/index.html#UMAN_config_general_homepage" target="_blank">{$lang->help}</a></label>
|
||||
<label class="x_control-label">{$lang->site_subtitle}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" name="site_subtitle" value="{$site_subtitle}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="_target_module">{$lang->start_module}</label>
|
||||
<div class="x_controls">
|
||||
<input class="module_search" type="text" name="index_module_srl" value="{$start_module->index_module_srl}" />
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue