mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +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->skin = Context::get('skin');
|
||||
$config->mskin = Context::get('mskin');
|
||||
$config->target = Context::get('target');
|
||||
$config->target_module_srl = Context::get('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()
|
||||
{
|
||||
// Get a list of skins(themes)
|
||||
// Get a list of skins
|
||||
$oModuleModel = getModel('module');
|
||||
$skin_list = $oModuleModel->getSkins($this->module_path);
|
||||
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
|
||||
$module_categories = $oModuleModel->getModuleCategories();
|
||||
|
||||
// Generated mid Wanted list
|
||||
$obj = new stdClass();
|
||||
$obj->site_srl = 0;
|
||||
|
|
@ -60,7 +64,7 @@ class integration_searchAdminView extends integration_search
|
|||
Context::set('mid_list',$module_categories);*/
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('skin_list..title');
|
||||
$security->encodeHTML('skin_list..title', 'mskin_list..title');
|
||||
|
||||
// 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) );
|
||||
|
|
|
|||
|
|
@ -53,32 +53,50 @@ class integration_searchView extends integration_search
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('integration_search');
|
||||
if(!$config) $config = new stdClass;
|
||||
if(!$config->skin)
|
||||
|
||||
// Set skin path
|
||||
$config = $oModuleModel->getModuleConfig('integration_search') ?: new stdClass;
|
||||
if(ends_with('Mobile', get_class($this), false))
|
||||
{
|
||||
$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)
|
||||
if(!$config->mskin || $config->mskin === '/USE_RESPONSIVE/')
|
||||
{
|
||||
$template_path = sprintf('./themes/%s/modules/integration_search/', $config_parse[0]);
|
||||
$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('%sskins/%s', $this->module_path, $config->skin);
|
||||
$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';
|
||||
}
|
||||
}
|
||||
}
|
||||
// Template path
|
||||
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';
|
||||
}
|
||||
}
|
||||
|
||||
$this->setTemplatePath($template_path);
|
||||
$skin_vars = ($config->skin_vars) ? unserialize($config->skin_vars) : new stdClass;
|
||||
Context::set('module_info', $skin_vars);
|
||||
|
||||
// Include or exclude target modules.
|
||||
$target = $config->target;
|
||||
if(!$target) $target = 'include';
|
||||
|
||||
|
|
@ -91,13 +109,7 @@ class integration_searchView extends integration_search
|
|||
// 검색 대상을 지정하지 않았을 때 검색 제한
|
||||
if($target === 'include' && !count($module_srl_list))
|
||||
{
|
||||
$oMessageObject = ModuleHandler::getModuleInstance('message');
|
||||
$oMessageObject->setError(-1);
|
||||
$oMessageObject->setMessage('msg_not_enabled');
|
||||
$oMessageObject->dispMessage();
|
||||
$this->setTemplatePath($oMessageObject->getTemplatePath());
|
||||
$this->setTemplateFile($oMessageObject->getTemplateFile());
|
||||
return;
|
||||
throw new Rhymix\Framework\Exception('msg_not_enabled');
|
||||
}
|
||||
|
||||
// Set a variable for search keyword
|
||||
|
|
|
|||
|
|
@ -23,7 +23,14 @@
|
|||
<select name="skin" id="skin">
|
||||
<option loop="$skin_list => $key, $val" value="{$key}" selected="selected"|cond="$config->skin == $key">{$val->title}</option>
|
||||
</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 class="x_control-group">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue