The final problem 🧣

This commit is contained in:
Abdulrahman
2019-05-26 20:39:23 +03:00
parent 412be337a7
commit c09e812534
7 changed files with 49 additions and 34 deletions

View File

@@ -68,7 +68,7 @@
<li class="nav-item<IF NAME="go_to==start"> activex</IF>" data-toggle="tooltip" data-placement="right" title="{lang.R_CPINDEX}">
<a class="first-level nav-link <IF NAME="go_to==start">nav-link-collapse</IF>" href="./"><i class="fa fa-fw fa-dashboard"></i> {lang.R_CPINDEX}</a>
<ul class="sidenav-second-level<IF NAME="go_to!=start"> collapse</IF>" id="collapseIndex">
<IF NAME="go_to==start">{go_menu_html}</IF>
<IF NAME="go_to==start" AND="" ISSET="go_menu_html">{go_menu_html}</IF>
</ul>
</li>
@@ -78,7 +78,7 @@
<a class="first-level nav-link<IF LOOP="current"><IF NAME="go_menu_html"> nav-link-collapse</IF></IF>" title="{{title}}" href="{{link}}"<IF LOOP="confirm"> onclick="return confirm_form();"</IF>>
<i class="fa fa-fw fa-{{icon}}"></i> {{title}} {{bubble}}
</a>
<IF NAME="go_menu_html">
<IF ISSET="go_menu_html">
<ul class="sidenav-second-level<IF LOOP="current"><ELSE> collapse</IF>" id="collapseItem{{i}}">
<IF LOOP="current">{go_menu_html}</IF>
</ul>

View File

@@ -55,9 +55,10 @@
{{plg_dsc}}
<ELSE>
{{extra_info.plugin_description}}
</IF>
</ELSE>
<br>
<small>{{extra_info.plugin_developer}}</small>
</IF>
</p>
</div>
@@ -155,7 +156,7 @@
</div>
</UNLESS>
<IF NAME="store_plugins_count gt 1" AND="case == check">
<IF NAME="store_plugins_count gt 1" NAME="case == check">
<div class="d-flex justify-content-end my-3">
<button id="updateAllBtn" type="button" onclick="updateAll()" class="btn btn-primary px-5">
<i class="fa fa-flash"></i> {lang.UPDATE_ALL}

View File

@@ -277,7 +277,7 @@ else
{
//display files or display pics and files only in search
$img_types = ['gif','jpg','png','bmp','jpeg','GIF','JPG','PNG','BMP','JPEG'];
$query['WHERE'] = $query['WHERE'] . (empty($query['WHERE']) ? '' : ' AND ') . "f.type NOT IN ('" . implode("', '", $img_types) . "')";
$query['WHERE'] = (empty($query['WHERE']) ? '' : $query['WHERE'] . ' AND ') . "f.type NOT IN ('" . implode("', '", $img_types) . "')";
}
else
{

View File

@@ -94,24 +94,25 @@ switch ($case):
) && ! preg_match('/^https?:\/\//', $installed_plugins[$row['plg_name']]['extra_info']['settings_page']);
foreach (['plugin_title', 'plugin_description'] as $localizedInfo)
foreach (['plugin_title', 'plugin_description'] as $localized_info)
{
if (is_array($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo]))
if (! empty($installed_plugins[$row['plg_name']]['extra_info'][$localized_info]) &&
is_array($installed_plugins[$row['plg_name']]['extra_info'][$localized_info]))
{
if (! empty($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo][$config['language']]))
if (! empty($installed_plugins[$row['plg_name']]['extra_info'][$localized_info][$config['language']]))
{
$installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo] =
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo][$config['language']], 100);
$installed_plugins[$row['plg_name']]['extra_info'][$localized_info] =
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localized_info][$config['language']], 100);
}
elseif (! empty($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo]['en']))
elseif (! empty($installed_plugins[$row['plg_name']]['extra_info'][$localized_info]['en']))
{
$installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo] =
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo]['en'], 100);
$installed_plugins[$row['plg_name']]['extra_info'][$localized_info] =
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localized_info]['en'], 100);
}
else
{
$installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo] =
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo][0], 100);
$installed_plugins[$row['plg_name']]['extra_info'][$localized_info] =
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localized_info][0], 100);
}
}
}

View File

@@ -838,6 +838,8 @@ function kleeja_date($time, $human_time = true, $format = false)
{
global $lang, $config;
$time = intval($time);
if (! defined('TIME_FORMAT'))
{
define('TIME_FORMAT', 'd-m-Y h:i a'); // to be moved to configs later

View File

@@ -169,11 +169,18 @@ class kleeja_style
$atts = call_user_func(['kleeja_style', '_get_attributes'], $matches[0]);
$condition = '';
foreach (['NAME' => '', 'LOOP' => '', 'AND' => ' && ', 'OR' => ' || '] as $attribute=>$separator)
foreach ([
'NAME' => '', 'LOOP' => '', 'AND' => ' && ', 'OR' => ' || ', 'ISSET' => ' isset', 'EMPTY' => ' empty'
] as $attribute=>$separator)
{
if (! empty($atts[$attribute]))
if (isset($atts[$attribute]))
{
$condition .= $separator . $this->parse_condition($atts[$attribute], ! empty($atts['LOOP']));
$haveParentheses = in_array($attribute, ['ISSET', 'EMPTY']);
$condition .= $separator . ($haveParentheses ? '(' : '') .
$this->parse_condition($atts[$attribute], ! empty($atts['LOOP'])) .
($haveParentheses ? ')' : '')
;
}
}
@@ -187,6 +194,11 @@ class kleeja_style
$char = [' eq ', ' lt ', ' gt ', ' lte ', ' gte ', ' neq ', '==', '!=', '>=', '<=', '<', '>'];
$reps = ['==', '<', '>', '<=', '>=', '!=', '==', '!=', '>=', '<=', '<', '>'];
if(trim($condition) == '')
{
return '';
}
$con = str_replace('$this->vars', '[----this-vars----]', $condition);
if (preg_match('/(.*)(' . implode('|', $char) . ')(.*)/i', $con, $arr))
@@ -243,7 +255,13 @@ class kleeja_style
preg_match(kleeja_style::reg('var'), $matches, $matches);
}
$var = ! empty($matches[2]) ? str_replace('.', '\'][\'', $matches[2]) : '';
$var = trim(! empty($matches[2]) ? str_replace('.', '\'][\'', $matches[2]) : '');
if(empty($var))
{
return '';
}
return ! empty($matches[1]) && trim($matches[1]) == '{{' ? '$value[\'' . $var . '\']' : '$this->vars[\'' . $var . '\']';
}
@@ -266,7 +284,7 @@ class kleeja_style
protected function reg($var)
{
$vars = get_class_vars(__CLASS__);
return ($vars['reg'][$var]);
return $vars['reg'][$var];
}
@@ -277,7 +295,7 @@ class kleeja_style
*/
protected function _get_attributes($tag)
{
preg_match_all('/([a-z]+)="(.+)"/iU', $tag, $attribute);
preg_match_all('/([a-z]+)="(.+)?"/iU', $tag, $attribute);
$attributes = [];
@@ -285,15 +303,8 @@ class kleeja_style
{
$att = strtoupper($attribute[1][$i]);
if (preg_match('/NAME|LOOP/', $att))
{
$attributes[$att] = preg_replace_callback(kleeja_style::reg('var'), ['kleeja_style', '_var_callback'], $attribute[2][$i]);
}
else
{
$attributes[$att] = preg_replace_callback(kleeja_style::reg('var'), ['kleeja_style', '_var_callback_att'], $attribute[2][$i]);
}
}
return $attributes;
}

View File

@@ -174,7 +174,7 @@ if ($show_online)
update_config('most_user_online_ever', $current_online_users . ':' . time());
}
$online_time = kleeja_date('d-m-Y h:i a', $online_time);
$online_time = kleeja_date($online_time, true, 'd-m-Y h:i a');
//before 1.8, styles computability