mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 12:02:24 +09:00
Support mobile and responsive skins in integration search module
This commit is contained in:
parent
1d35511e04
commit
ea964e72ba
5 changed files with 51 additions and 26 deletions
|
|
@ -29,6 +29,7 @@ class integration_searchAdminController extends integration_search
|
||||||
$config = (object)get_object_vars($config);
|
$config = (object)get_object_vars($config);
|
||||||
|
|
||||||
$config->skin = Context::get('skin');
|
$config->skin = Context::get('skin');
|
||||||
|
$config->mskin = Context::get('mskin');
|
||||||
$config->target = Context::get('target');
|
$config->target = Context::get('target');
|
||||||
$config->target_module_srl = Context::get('target_module_srl');
|
$config->target_module_srl = Context::get('target_module_srl');
|
||||||
if(!$config->target_module_srl) $config->target_module_srl = '';
|
if(!$config->target_module_srl) $config->target_module_srl = '';
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,16 @@ class integration_searchAdminView extends integration_search
|
||||||
*/
|
*/
|
||||||
function dispIntegration_searchAdminContent()
|
function dispIntegration_searchAdminContent()
|
||||||
{
|
{
|
||||||
// Get a list of skins(themes)
|
// Get a list of skins
|
||||||
$oModuleModel = getModel('module');
|
$oModuleModel = getModel('module');
|
||||||
$skin_list = $oModuleModel->getSkins($this->module_path);
|
$skin_list = $oModuleModel->getSkins($this->module_path);
|
||||||
Context::set('skin_list',$skin_list);
|
Context::set('skin_list',$skin_list);
|
||||||
|
$mskin_list = $oModuleModel->getSkins($this->module_path, 'm.skins');
|
||||||
|
Context::set('mskin_list', $mskin_list);
|
||||||
|
|
||||||
// Get a list of module categories
|
// Get a list of module categories
|
||||||
$module_categories = $oModuleModel->getModuleCategories();
|
$module_categories = $oModuleModel->getModuleCategories();
|
||||||
|
|
||||||
// Generated mid Wanted list
|
// Generated mid Wanted list
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
$obj->site_srl = 0;
|
$obj->site_srl = 0;
|
||||||
|
|
@ -60,7 +64,7 @@ class integration_searchAdminView extends integration_search
|
||||||
Context::set('mid_list',$module_categories);*/
|
Context::set('mid_list',$module_categories);*/
|
||||||
|
|
||||||
$security = new Security();
|
$security = new Security();
|
||||||
$security->encodeHTML('skin_list..title');
|
$security->encodeHTML('skin_list..title', 'mskin_list..title');
|
||||||
|
|
||||||
// Sample Code
|
// Sample Code
|
||||||
Context::set('sample_code', htmlspecialchars('<form action="{getUrl()}" method="get"><input type="hidden" name="vid" value="{$vid}" /><input type="hidden" name="mid" value="{$mid}" /><input type="hidden" name="act" value="IS" /><input type="text" name="is_keyword" value="{$is_keyword}" /><input class="btn" type="submit" value="{$lang->cmd_search}" /></form>', ENT_COMPAT | ENT_HTML401, 'UTF-8', false) );
|
Context::set('sample_code', htmlspecialchars('<form action="{getUrl()}" method="get"><input type="hidden" name="vid" value="{$vid}" /><input type="hidden" name="mid" value="{$mid}" /><input type="hidden" name="act" value="IS" /><input type="text" name="is_keyword" value="{$is_keyword}" /><input class="btn" type="submit" value="{$lang->cmd_search}" /></form>', ENT_COMPAT | ENT_HTML401, 'UTF-8', false) );
|
||||||
|
|
|
||||||
|
|
@ -54,31 +54,49 @@ class integration_searchView extends integration_search
|
||||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = $oModuleModel->getModuleConfig('integration_search');
|
// Set skin path
|
||||||
if(!$config) $config = new stdClass;
|
$config = $oModuleModel->getModuleConfig('integration_search') ?: new stdClass;
|
||||||
if(!$config->skin)
|
if(ends_with('Mobile', get_class($this), false))
|
||||||
{
|
{
|
||||||
|
if(!$config->mskin || $config->mskin === '/USE_RESPONSIVE/')
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sskins/%s/', $this->module_path, $config->skin);
|
||||||
|
if(!is_dir($template_path) || !$config->skin)
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sskins/%s/', $this->module_path, 'default');
|
||||||
|
$config->mskin = 'default';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sm.skins/%s/', $this->module_path, $config->mskin);
|
||||||
|
if(!is_dir($template_path) || !$config->mskin)
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sm.skins/%s/', $this->module_path, 'default');
|
||||||
|
$config->mskin = 'default';
|
||||||
|
}
|
||||||
|
if(!is_dir($template_path))
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sskins/%s/', $this->module_path, 'default');
|
||||||
|
$config->mskin = 'default';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sskins/%s/', $this->module_path, $config->skin);
|
||||||
|
if(!is_dir($template_path) || !$config->skin)
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sskins/%s/', $this->module_path, 'default');
|
||||||
$config->skin = 'default';
|
$config->skin = 'default';
|
||||||
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//check theme
|
|
||||||
$config_parse = explode('|@|', $config->skin);
|
|
||||||
if (count($config_parse) > 1)
|
|
||||||
{
|
|
||||||
$template_path = sprintf('./themes/%s/modules/integration_search/', $config_parse[0]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Template path
|
|
||||||
$this->setTemplatePath($template_path);
|
$this->setTemplatePath($template_path);
|
||||||
$skin_vars = ($config->skin_vars) ? unserialize($config->skin_vars) : new stdClass;
|
$skin_vars = ($config->skin_vars) ? unserialize($config->skin_vars) : new stdClass;
|
||||||
Context::set('module_info', $skin_vars);
|
Context::set('module_info', $skin_vars);
|
||||||
|
|
||||||
|
// Include or exclude target modules.
|
||||||
$target = $config->target;
|
$target = $config->target;
|
||||||
if(!$target) $target = 'include';
|
if(!$target) $target = 'include';
|
||||||
|
|
||||||
|
|
@ -91,13 +109,7 @@ class integration_searchView extends integration_search
|
||||||
// 검색 대상을 지정하지 않았을 때 검색 제한
|
// 검색 대상을 지정하지 않았을 때 검색 제한
|
||||||
if($target === 'include' && !count($module_srl_list))
|
if($target === 'include' && !count($module_srl_list))
|
||||||
{
|
{
|
||||||
$oMessageObject = ModuleHandler::getModuleInstance('message');
|
throw new Rhymix\Framework\Exception('msg_not_enabled');
|
||||||
$oMessageObject->setError(-1);
|
|
||||||
$oMessageObject->setMessage('msg_not_enabled');
|
|
||||||
$oMessageObject->dispMessage();
|
|
||||||
$this->setTemplatePath($oMessageObject->getTemplatePath());
|
|
||||||
$this->setTemplateFile($oMessageObject->getTemplateFile());
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a variable for search keyword
|
// Set a variable for search keyword
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,14 @@
|
||||||
<select name="skin" id="skin">
|
<select name="skin" id="skin">
|
||||||
<option loop="$skin_list => $key, $val" value="{$key}" selected="selected"|cond="$config->skin == $key">{$val->title}</option>
|
<option loop="$skin_list => $key, $val" value="{$key}" selected="selected"|cond="$config->skin == $key">{$val->title}</option>
|
||||||
</select>
|
</select>
|
||||||
<p class="x_help-inline">{$lang->about_skin}</p>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label for="mskin" class="x_control-label">{$lang->mobile_skin}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<select name="mskin" id="mskin">
|
||||||
|
<option loop="$mskin_list => $key, $val" value="{$key}" selected="selected"|cond="$config->mskin == $key">{$val->title}</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
|
|
|
||||||
|
|
@ -1071,9 +1071,10 @@ class moduleModel extends module
|
||||||
$path = substr($path, 0, -1);
|
$path = substr($path, 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$skin_list = array();
|
||||||
$skin_path = sprintf("%s/%s/", $path, $dir);
|
$skin_path = sprintf("%s/%s/", $path, $dir);
|
||||||
$list = FileHandler::readDir($skin_path);
|
$list = FileHandler::readDir($skin_path);
|
||||||
if(!count($list)) return;
|
//if(!count($list)) return;
|
||||||
|
|
||||||
natcasesort($list);
|
natcasesort($list);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue