Skip to content

Commit

Permalink
add config "template" & "templates['jqm']"
Browse files Browse the repository at this point in the history
携帯対応レンダラーで使用するテンプレートを hypconf で設定可能にした。
  • Loading branch information
nao-pon committed Jan 3, 2013
1 parent c1415f7 commit a04bcb6
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 32 deletions.
83 changes: 51 additions & 32 deletions xoops_trust_path/modules/hypconf/admin/k_tai_conf.php
Expand Up @@ -4,6 +4,8 @@
* $Id: k_tai_conf.php,v 1.4 2011/12/13 08:12:18 nao-pon Exp $
*/

$_k_tai_conf_template_dirs = hypconfGetDirnameAsOptions(XOOPS_TRUST_PATH . '/class/hyp_common/ktairender/templates');

$config['main_switch'] = 'use_k_tai_render';

$config[] = array(
Expand All @@ -14,46 +16,63 @@
'valuetype' => 'text',
'size' => 80
);
$config[] = array(
'name' => 'themeSet',
'title' => $constpref.'_THEMESET',
'description' => $constpref.'_THEMESET_DESC',
'formtype' => 'theme',
'valuetype' => 'text',
'notempty' => true
);
$config[] = array(
'name' => 'templateSet',
'title' => $constpref.'_TEMPLATESET',
'description' => $constpref.'_TEMPLATESET_DESC',
'formtype' => 'tplset',
'valuetype' => 'text',
'notempty' => true
);
$config[] = array(
'name' => 'themeSet',
'title' => $constpref.'_THEMESET',
'description' => $constpref.'_THEMESET_DESC',
'formtype' => 'theme',
'valuetype' => 'text',
'notempty' => true
);
$config[] = array(
'name' => 'templateSet',
'title' => $constpref.'_TEMPLATESET',
'description' => $constpref.'_TEMPLATESET_DESC',
'formtype' => 'tplset',
'valuetype' => 'text',
'notempty' => true
);
$config[] = array(
'name' => 'template',
'title' => $constpref.'_TEMPLATE',
'description' => $constpref.'_TEMPLATE_DESC',
'formtype' => 'select',
'valuetype' => 'text',
'options' => $_k_tai_conf_template_dirs
);
$config[] = array(
'name' => 'jquery_profiles',
'title' => $constpref.'_JQM_PROFILES',
'description' => $constpref.'_JQM_PROFILES_DESC',
'formtype' => 'textbox',
'valuetype' => 'text'
);
$config[] = array(
'name' => 'themeSets',
'arrkey' => 'jqm',
'title' => $constpref.'_THEMESETS_JQM',
'description' => $constpref.'_THEMESETS_JQM_DESC',
'formtype' => 'theme',
'valuetype' => 'text',
'notempty' => true
$config[] = array(
'name' => 'themeSets',
'arrkey' => 'jqm',
'title' => $constpref.'_THEMESETS_JQM',
'description' => $constpref.'_THEMESETS_JQM_DESC',
'formtype' => 'theme',
'valuetype' => 'text',
'notempty' => true
);
$config[] = array(
'name' => 'templateSets',
'arrkey' => 'jqm',
'title' => $constpref.'_TEMPLATESETS_JQM',
'description' => $constpref.'_TEMPLATESETS_JQM_DESC',
'formtype' => 'tplset',
'valuetype' => 'text',
'notempty' => true
$config[] = array(
'name' => 'templateSets',
'arrkey' => 'jqm',
'title' => $constpref.'_TEMPLATESETS_JQM',
'description' => $constpref.'_TEMPLATESETS_JQM_DESC',
'formtype' => 'tplset',
'valuetype' => 'text',
'notempty' => true
);
$config[] = array(
'name' => 'templates',
'arrkey' => 'jqm',
'title' => $constpref.'_TEMPLATE_JQM',
'description' => $constpref.'_TEMPLATE_JQM_DESC',
'formtype' => 'select',
'valuetype' => 'text',
'options' => $_k_tai_conf_template_dirs
);
$config[] = array(
'name' => 'jquery_theme',
Expand Down
17 changes: 17 additions & 0 deletions xoops_trust_path/modules/hypconf/include/admin_func.php
Expand Up @@ -392,3 +392,20 @@ function hypconf_initVal($key) {
}
return $val;
}

function hypconfGetDirnameAsOptions($dir) {
$dir = rtrim($dir, '/') . '/';
$options = array();
if ($handle = opendir($dir)) {
while (false !== ($entry = readdir($handle))) {
if ($entry !== '.' && $entry !== '..' && is_dir($dir.$entry)) {
$options[$entry] = array(
'confop_name' => $entry,
'confop_value' => $entry
);
}
}
ksort($options);
}
return $options;
}
4 changes: 4 additions & 0 deletions xoops_trust_path/modules/hypconf/language/english/modinfo.php
Expand Up @@ -60,12 +60,16 @@
define($constpref.'_THEMESET_DESC', 'Theme name to use when mobile support(If you do not specify the switching of the theme does not)');
define($constpref.'_TEMPLATESET', 'DB template set');
define($constpref.'_TEMPLATESET_DESC', 'DB template set name to use when mobile support (if not specified, the default set of templates will be used)');
define($constpref.'_TEMPLATE', 'Template of K-Tai Renderer');
define($constpref.'_TEMPLATE_DESC', 'Template directory in "'.XOOPS_TRUST_PATH.'/class/hyp_common/ktairender/templates" for K-Tai Renderer');
define($constpref.'_JQM_PROFILES', 'jQuery Mobile');
define($constpref.'_JQM_PROFILES_DESC', 'Profile name to apply jQuery Mobile. Them separated by comma. If the profile name defined in the renderer to mobile phones, "docomo, au, softbank, willcom, android, iphone, ipod, ipad, and windows mobile" you can use.');
define($constpref.'_THEMESETS_JQM', 'XOOPS theme (jqm)');
define($constpref.'_THEMESETS_JQM_DESC', 'Theme name when applying jQuery Mobile (if not specified, the name at the time of mobile-enabled theme will be used)');
define($constpref.'_TEMPLATESETS_JQM', 'DB template set (jqm)');
define($constpref.'_TEMPLATESETS_JQM_DESC', 'DB template name when applying a set of jQuery Mobile (if not specified, the name at the time of mobile-enabled theme will be used)');
define($constpref.'_TEMPLATE_JQM', 'Template of K-Tai Renderer(jqm)');
define($constpref.'_TEMPLATE_JQM_DESC', 'Template directory in "'.XOOPS_TRUST_PATH.'/class/hyp_common/ktairender/templates" for K-Tai Renderer with jQuery Mobile');
define($constpref.'_JQM_THEME', 'jqm Theme');
define($constpref.'_JQM_THEME_DESC', 'JQuery Mobile theme of the entire page. In normal condition "a, b, c, d, e" is valid.');
define($constpref.'_JQM_THEME_CONTENT', 'Main section');
Expand Down
4 changes: 4 additions & 0 deletions xoops_trust_path/modules/hypconf/language/ja_utf8/modinfo.php
Expand Up @@ -60,12 +60,16 @@
define($constpref.'_THEMESET_DESC', 'モバイル対応時に使用するテーマ名(指定しない場合はテーマの切り替えをしません)');
define($constpref.'_TEMPLATESET', 'DBテンプレートセット');
define($constpref.'_TEMPLATESET_DESC', 'モバイル対応時に使用するDBテンプレートセット名(指定しない場合はデフォルトテンプレートセットが使用されます)');
define($constpref.'_TEMPLATE', '携帯対応レンダラーテンプレート');
define($constpref.'_TEMPLATE_DESC', '"'.XOOPS_TRUST_PATH.'/class/hyp_common/ktairender/templates" ディレクトリに配置した携帯対応レンダラー用のテンプレートディレクトリ名');
define($constpref.'_JQM_PROFILES', 'jQuery Mobile');
define($constpref.'_JQM_PROFILES_DESC', 'jQuery Mobile を適用するプロファイル名をカンマ区切りで記述。プロファイル名は携帯対応レンダラーで定義されていて、docomo, au, softbank, willcom, android, iphone, ipod, ipad, windows mobile などが使用できます。');
define($constpref.'_THEMESETS_JQM', 'XOOPSテーマ(jqm)');
define($constpref.'_THEMESETS_JQM_DESC', 'jQuery Mobile 適用時のテーマ名(指定しない場合は、モバイル対応時のテーマ名が使用されます)');
define($constpref.'_TEMPLATESETS_JQM', 'DBテンプレートセット(jqm)');
define($constpref.'_TEMPLATESETS_JQM_DESC', 'jQuery Mobile 適用時のDBテンプレートセット名(指定しない場合は、モバイル対応時のテーマ名が使用されます)');
define($constpref.'_TEMPLATE_JQM', '携帯対応レンダラーテンプレート(jqm)');
define($constpref.'_TEMPLATE_JQM_DESC', 'jQuery Mobile 適用時の "'.XOOPS_TRUST_PATH.'/class/hyp_common/ktairender/templates" ディレクトリに配置した携帯対応レンダラー用のテンプレートディレクトリ名');
define($constpref.'_JQM_THEME', 'jqmテーマ');
define($constpref.'_JQM_THEME_DESC', 'ページ全体の jQuery Mobile のテーマ。標準では a, b, c, d, e が有効です。');
define($constpref.'_JQM_THEME_CONTENT', 'メイン部');
Expand Down
Expand Up @@ -60,12 +60,16 @@
define($constpref.'_THEMESET_DESC', 'モバイル対応時に使用するテーマ名(指定しない場合はテーマの切り替えをしません)');
define($constpref.'_TEMPLATESET', 'DBテンプレートセット');
define($constpref.'_TEMPLATESET_DESC', 'モバイル対応時に使用するDBテンプレートセット名(指定しない場合はデフォルトテンプレートセットが使用されます)');
define($constpref.'_TEMPLATE', '携帯対応レンダラーテンプレート');
define($constpref.'_TEMPLATE_DESC', '"'.XOOPS_TRUST_PATH.'/class/hyp_common/ktairender/templates" ディレクトリに配置した携帯対応レンダラー用のテンプレートディレクトリ名');
define($constpref.'_JQM_PROFILES', 'jQuery Mobile');
define($constpref.'_JQM_PROFILES_DESC', 'jQuery Mobile を適用するプロファイル名をカンマ区切りで記述。プロファイル名は携帯対応レンダラーで定義されていて、docomo, au, softbank, willcom, android, iphone, ipod, ipad, windows mobile などが使用できます。');
define($constpref.'_THEMESETS_JQM', 'XOOPSテーマ(jqm)');
define($constpref.'_THEMESETS_JQM_DESC', 'jQuery Mobile 適用時のテーマ名(指定しない場合は、モバイル対応時のテーマ名が使用されます)');
define($constpref.'_TEMPLATESETS_JQM', 'DBテンプレートセット(jqm)');
define($constpref.'_TEMPLATESETS_JQM_DESC', 'jQuery Mobile 適用時のDBテンプレートセット名(指定しない場合は、モバイル対応時のテーマ名が使用されます)');
define($constpref.'_TEMPLATE_JQM', '携帯対応レンダラーテンプレート(jqm)');
define($constpref.'_TEMPLATE_JQM_DESC', 'jQuery Mobile 適用時の "'.XOOPS_TRUST_PATH.'/class/hyp_common/ktairender/templates" ディレクトリに配置した携帯対応レンダラー用のテンプレートディレクトリ名');
define($constpref.'_JQM_THEME', 'jqmテーマ');
define($constpref.'_JQM_THEME_DESC', 'ページ全体の jQuery Mobile のテーマ。標準では a, b, c, d, e が有効です。');
define($constpref.'_JQM_THEME_CONTENT', 'メイン部');
Expand Down

0 comments on commit a04bcb6

Please sign in to comment.