mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Merge branch 'develop' into pr/color-scheme
This commit is contained in:
commit
bcfb96dda7
14 changed files with 59 additions and 29 deletions
|
|
@ -341,10 +341,8 @@ class Validator
|
|||
continue;
|
||||
}
|
||||
|
||||
$func_body = preg_replace('/\\$(\w+)/', '$c[\'$1\']', $cond['test']);
|
||||
$func = create_function('$c', "return !!({$func_body});");
|
||||
|
||||
if($func($fields))
|
||||
$expr = '!!(' . preg_replace('/\\$(\w+)/', '$value[\'$1\']', $cond['test']) . ')';
|
||||
if(self::_execExpression($fields, $expr))
|
||||
{
|
||||
$filter[$cond['attr']] = $cond['value'];
|
||||
}
|
||||
|
|
@ -621,11 +619,15 @@ class Validator
|
|||
case 'enum':
|
||||
return in_array($value, $rule['test']);
|
||||
case 'expr':
|
||||
if(!$rule['func_test'])
|
||||
if(is_callable($rule['func_test']))
|
||||
{
|
||||
$rule['func_test'] = create_function('$a', 'return (' . preg_replace('/\$\$/', '$a', html_entity_decode($rule['test'])) . ');');
|
||||
return $rule['func_test']($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$expr = '(' . preg_replace('/\$\$/', '$value', html_entity_decode($rule['test'])) . ')';
|
||||
return self::_execExpression($value, $expr);
|
||||
}
|
||||
return $rule['func_test']($value);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -829,6 +831,25 @@ class Validator
|
|||
|
||||
return "(function($,v){\nv=xe.getApp('validator')[0];if(!v)return;\n{$addrules}\nv.cast('ADD_FILTER',['{$ruleset}', {{$content}}]);\n{$messages}\n})(jQuery);";
|
||||
}
|
||||
|
||||
/**
|
||||
* Polyfill for create_function()
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param string $expression
|
||||
* @return mixed
|
||||
*/
|
||||
protected static function _execExpression($value, $expression)
|
||||
{
|
||||
$hash_key = sha1($expression);
|
||||
$filename = RX_BASEDIR . 'files/cache/validator/' . $hash_key . '.php';
|
||||
if (!Rhymix\Framework\Storage::exists($filename))
|
||||
{
|
||||
$buff = '<?php if(!defined(\'RX_VERSION\')) return;' . "\n" . 'return ' . $expression . ';' . "\n";
|
||||
Rhymix\Framework\Storage::write($filename, $buff);
|
||||
}
|
||||
return (include $filename);
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file Validator.class.php */
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
namespace Rhymix\Framework\Drivers\Push;
|
||||
|
||||
use Rhymix\Framework\Drivers\PushInterface;
|
||||
|
||||
/**
|
||||
* The base class for other Push drivers.
|
||||
*/
|
||||
abstract class Base implements \Rhymix\Framework\Drivers\PushInterface
|
||||
abstract class Base implements PushInterface
|
||||
{
|
||||
/**
|
||||
* The configuration is stored here.
|
||||
|
|
@ -30,9 +32,9 @@ abstract class Base implements \Rhymix\Framework\Drivers\PushInterface
|
|||
* Create a new instance of the current Push driver, using the given settings.
|
||||
*
|
||||
* @param array $config
|
||||
* @return Base
|
||||
* @return PushInterface
|
||||
*/
|
||||
public static function getInstance(array $config): Base
|
||||
public static function getInstance(array $config): PushInterface
|
||||
{
|
||||
return new static($config);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ interface PushInterface
|
|||
* @param array $config
|
||||
* @return void
|
||||
*/
|
||||
public static function getInstance(array $config): object;
|
||||
public static function getInstance(array $config): PushInterface;
|
||||
|
||||
/**
|
||||
* Get the human-readable name of this Push driver.
|
||||
|
|
|
|||
|
|
@ -771,7 +771,11 @@ function doChangeLangType(obj) {
|
|||
}
|
||||
}
|
||||
function setLangType(lang_type) {
|
||||
XE.cookie.set("lang_type", lang_type, { path: "/", expires: 3650 });
|
||||
var baseurl = XE.URI(default_url).pathname();
|
||||
if (baseurl !== '/') {
|
||||
XE.cookie.remove('lang_type', { path: '/' });
|
||||
}
|
||||
XE.cookie.set('lang_type', lang_type, { path: baseurl, expires: 365 });
|
||||
}
|
||||
|
||||
/* 미리보기 */
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@
|
|||
}
|
||||
else if(/\.(mp4|webm|ogv)$/i.test(result.source_filename) && opt.autoinsertTypes.video) {
|
||||
if(result.original_type === 'image/gif') {
|
||||
temp_code += '<video src="' + result.download_url + '" autoplay loop muted data-file-srl="' + result.file_srl + '" />';
|
||||
temp_code += '<video src="' + result.download_url + '" autoplay loop muted playsinline data-file-srl="' + result.file_srl + '" />';
|
||||
} else {
|
||||
temp_code += '<video src="' + result.download_url + '" controls data-file-srl="' + result.file_srl + '" />';
|
||||
}
|
||||
|
|
@ -332,7 +332,7 @@
|
|||
}
|
||||
else if(/\.(mp4|webm|ogv)$/i.test(result.source_filename)) {
|
||||
if(result.original_type === 'image/gif') {
|
||||
temp_code += '<video src="' + result.download_url + '" autoplay loop muted data-file-srl="' + result.file_srl + '" />';
|
||||
temp_code += '<video src="' + result.download_url + '" autoplay loop muted playsinline data-file-srl="' + result.file_srl + '" />';
|
||||
} else {
|
||||
temp_code += '<video src="' + result.download_url + '" controls data-file-srl="' + result.file_srl + '" />';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,9 +83,9 @@
|
|||
<script>
|
||||
__xe_admin_gnb_txs.push('{'__xe_admin_gnb_tx_' . md5($value['href'])}');
|
||||
</script>
|
||||
<a href="{\RX_BASEURL}{$value['href']}" data-href="{md5($value['href'])}" title="{$value['text']}"><span class="tx">{$value['text']}</span></a>
|
||||
<a href="{str_replace('//', '/', \RX_BASEURL . $value['href'])}" data-href="{md5($value['href'])}" title="{$value['text']}"><span class="tx">{$value['text']}</span></a>
|
||||
<ul cond="count($value['list'])" style="display:block"|cond="$_COOKIE['__xe_admin_gnb_tx_' . md5($value['href'])] == 'open'">
|
||||
<li loop="$value['list']=>$key2,$value2" cond="$value2['text']!=''" class="active_"|cond="$value2['text'] == $subMenuTitle" ><a href="{\RX_BASEURL}{$value2['href']}" title="{$value2['text']}">{$value2['text']}</a></li>
|
||||
<li loop="$value['list']=>$key2,$value2" cond="$value2['text']!=''" class="active_"|cond="$value2['text'] == $subMenuTitle" ><a href="{str_replace('//', '/', \RX_BASEURL . $value2['href'])}" title="{$value2['text']}">{$value2['text']}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<!--@end-->
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@
|
|||
<li class="x_disabled"|cond="$page == $page_navigation->last_page"><a href="{getUrl('page', $page_navigation->last_page)}" title="{$page_navigation->last_page}">{$lang->last_page} »</a></li>
|
||||
</ul>
|
||||
</form>
|
||||
<form action="./" class="search x_input-append x_pull-right" no-error-return-url="true" cond="$act!=dispAutoinstallAdminInstalledPackages">
|
||||
<form action="./" class="search x_input-append x_pull-right" no-error-return-url="true" cond="$act !== 'dispAutoinstallAdminInstalledPackages'">
|
||||
<input type="hidden" name="module" value="admin" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="hidden" name="order_target" value="{$order_target}" />
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class fileAdminController extends file
|
|||
$config->allow_outlink_site = Context::get('allow_outlink_site');
|
||||
$config->allow_multimedia_direct_download = Context::get('allow_multimedia_direct_download') === 'Y' ? 'Y' : 'N';
|
||||
$config->download_short_url = Context::get('download_short_url') === 'Y' ? 'Y' : 'N';
|
||||
$config->inline_download_format = array_map('utf8_trim', Context::get('inline_download_format'));
|
||||
$config->inline_download_format = array_map('utf8_trim', Context::get('inline_download_format') ?: []);
|
||||
|
||||
// Save and redirect
|
||||
$output = getController('module')->insertModuleConfig('file', $config);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class integration_searchAdminController extends integration_search
|
|||
{
|
||||
// Get configurations (using module model object)
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('integration_search');
|
||||
$config = $oModuleModel->getModuleConfig('integration_search') ?: new stdClass;
|
||||
$config = (object)get_object_vars($config);
|
||||
|
||||
$config->skin = Context::get('skin');
|
||||
|
|
|
|||
|
|
@ -1103,7 +1103,6 @@ class memberController extends member
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
unset($_SESSION['rechecked_password_step']);
|
||||
|
||||
// Get current module config and user info
|
||||
$config = MemberModel::getMemberConfig();
|
||||
|
|
@ -1286,6 +1285,7 @@ class memberController extends member
|
|||
|
||||
// Call a trigger after successfully modified (after)
|
||||
ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $member_info);
|
||||
unset($_SESSION['rechecked_password_step']);
|
||||
$this->setSessionInfo();
|
||||
|
||||
// Return result
|
||||
|
|
|
|||
|
|
@ -8,15 +8,15 @@
|
|||
<p class="x_control-label">{$lang->identifier}</p>
|
||||
<div class="x_controls">
|
||||
<label class="x_inline" for="identifiers_user_id">
|
||||
<input type="checkbox" name="identifiers[]" id="identifiers_user_id" value="user_id" checked="checked"|cond="$config->identifier === 'user_id' || in_array('user_id', $config->identifiers)" />
|
||||
<input type="checkbox" name="identifiers[]" id="identifiers_user_id" value="user_id" checked="checked"|cond="$config->identifier === 'user_id' || (is_array($config->identifiers) && in_array('user_id', $config->identifiers))" />
|
||||
{$lang->user_id}
|
||||
</label>
|
||||
<label class="x_inline" for="identifiers_email_address">
|
||||
<input type="checkbox" name="identifiers[]" id="identifiers_email_address" value="email_address" checked="checked"|cond="$config->identifier === 'email_address' || in_array('email_address', $config->identifiers)" />
|
||||
<input type="checkbox" name="identifiers[]" id="identifiers_email_address" value="email_address" checked="checked"|cond="$config->identifier === 'email_address' || (is_array($config->identifiers) && in_array('email_address', $config->identifiers))" />
|
||||
{$lang->email_address}
|
||||
</label>
|
||||
<label class="x_inline" for="identifiers_phone_number">
|
||||
<input type="checkbox" name="identifiers[]" id="identifiers_phone_number" value="phone_number" checked="checked"|cond="$config->identifier === 'phone_number' || in_array('phone_number', $config->identifiers)" />
|
||||
<input type="checkbox" name="identifiers[]" id="identifiers_phone_number" value="phone_number" checked="checked"|cond="$config->identifier === 'phone_number' || (is_array($config->identifiers) && in_array('phone_number', $config->identifiers))" />
|
||||
{$lang->phone_number}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_identifier}</p>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
<rule name="less_than_1000" type="expr" test="$$ < 1000" />
|
||||
<rule name="less_than_10000" type="expr" test="$$ < 10000" />
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="max_level" required="true" rule="number,less_than_1000" />
|
||||
<field name="max_level" required="true" rule="number,less_than_10000" />
|
||||
<field name="point_name" required="true" />
|
||||
<field name="level_icon" required="true" default="default" />
|
||||
</fields>
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ class pollAdminView extends poll
|
|||
// Get the list
|
||||
$oPollAdminModel = getAdminModel('poll');
|
||||
$output = $oPollAdminModel->getPollListWithMember($args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
// check poll type. document or comment
|
||||
if(is_array($output->data) && count($output->data))
|
||||
|
|
@ -88,7 +92,6 @@ class pollAdminView extends poll
|
|||
Context::set('page', $output->page);
|
||||
Context::set('poll_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('module_list', $module_list);
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('poll_list..title', 'poll_list..nick_name');
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ class widgetController extends widget
|
|||
$oModuleModel = getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($path, $skin);
|
||||
|
||||
for($i=0;$i<count($skin_info->colorset);$i++)
|
||||
$colorset_list = [];
|
||||
foreach($skin_info->colorset ?: [] as $colorset)
|
||||
{
|
||||
$colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title);
|
||||
$colorset_list[] = $colorset;
|
||||
$colorset_list[] = sprintf('%s|@|%s', $colorset->name, $colorset->title);
|
||||
}
|
||||
|
||||
if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue