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}"> <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> <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"> <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> </ul>
</li> </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>> <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}} <i class="fa fa-fw fa-{{icon}}"></i> {{title}} {{bubble}}
</a> </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}}"> <ul class="sidenav-second-level<IF LOOP="current"><ELSE> collapse</IF>" id="collapseItem{{i}}">
<IF LOOP="current">{go_menu_html}</IF> <IF LOOP="current">{go_menu_html}</IF>
</ul> </ul>
@@ -120,4 +120,4 @@
</nav> </nav>
<div class="content-wrapper"> <div class="content-wrapper">
<div class="container-fluid"> <div class="container-fluid">

View File

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

View File

@@ -137,7 +137,7 @@ else
{ {
// //
//Delete all user files [only one user] //Delete all user files [only one user]
// //
if (ig('deletefiles')) if (ig('deletefiles'))
{ {
@@ -250,7 +250,7 @@ else
//posts search .. //posts search ..
if (ig('search_id')) if (ig('search_id'))
{ {
//get search filter //get search filter
$filter = get_filter(g('search_id'), 'file_search', false, 'filter_uid'); $filter = get_filter(g('search_id'), 'file_search', false, 'filter_uid');
$deletelink = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&deletefiles=' . g('search_id'); $deletelink = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&deletefiles=' . g('search_id');
$is_search = true; $is_search = true;
@@ -277,7 +277,7 @@ else
{ {
//display files or display pics and files only in search //display files or display pics and files only in search
$img_types = ['gif','jpg','png','bmp','jpeg','GIF','JPG','PNG','BMP','JPEG']; $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 else
{ {
@@ -303,7 +303,7 @@ else
} }
//pager //pager
$currentPage = ig('page') ? g('page', 'int') : 1; $currentPage = ig('page') ? g('page', 'int') : 1;
$Pager = new Pagination($files_acp_perpage, $nums_rows, $currentPage); $Pager = new Pagination($files_acp_perpage, $nums_rows, $currentPage);
$start = $Pager->getStartRow(); $start = $Pager->getStartRow();

View File

@@ -94,24 +94,25 @@ switch ($case):
) && ! preg_match('/^https?:\/\//', $installed_plugins[$row['plg_name']]['extra_info']['settings_page']); ) && ! 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] = $installed_plugins[$row['plg_name']]['extra_info'][$localized_info] =
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo][$config['language']], 100); 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] = $installed_plugins[$row['plg_name']]['extra_info'][$localized_info] =
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo]['en'], 100); shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localized_info]['en'], 100);
} }
else else
{ {
$installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo] = $installed_plugins[$row['plg_name']]['extra_info'][$localized_info] =
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo][0], 100); 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; global $lang, $config;
$time = intval($time);
if (! defined('TIME_FORMAT')) if (! defined('TIME_FORMAT'))
{ {
define('TIME_FORMAT', 'd-m-Y h:i a'); // to be moved to configs later 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]); $atts = call_user_func(['kleeja_style', '_get_attributes'], $matches[0]);
$condition = ''; $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 ', '==', '!=', '>=', '<=', '<', '>']; $char = [' eq ', ' lt ', ' gt ', ' lte ', ' gte ', ' neq ', '==', '!=', '>=', '<=', '<', '>'];
$reps = ['==', '<', '>', '<=', '>=', '!=', '==', '!=', '>=', '<=', '<', '>']; $reps = ['==', '<', '>', '<=', '>=', '!=', '==', '!=', '>=', '<=', '<', '>'];
if(trim($condition) == '')
{
return '';
}
$con = str_replace('$this->vars', '[----this-vars----]', $condition); $con = str_replace('$this->vars', '[----this-vars----]', $condition);
if (preg_match('/(.*)(' . implode('|', $char) . ')(.*)/i', $con, $arr)) if (preg_match('/(.*)(' . implode('|', $char) . ')(.*)/i', $con, $arr))
@@ -243,7 +255,13 @@ class kleeja_style
preg_match(kleeja_style::reg('var'), $matches, $matches); 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 . '\']'; return ! empty($matches[1]) && trim($matches[1]) == '{{' ? '$value[\'' . $var . '\']' : '$this->vars[\'' . $var . '\']';
} }
@@ -266,7 +284,7 @@ class kleeja_style
protected function reg($var) protected function reg($var)
{ {
$vars = get_class_vars(__CLASS__); $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) protected function _get_attributes($tag)
{ {
preg_match_all('/([a-z]+)="(.+)"/iU', $tag, $attribute); preg_match_all('/([a-z]+)="(.+)?"/iU', $tag, $attribute);
$attributes = []; $attributes = [];
@@ -285,14 +303,7 @@ class kleeja_style
{ {
$att = strtoupper($attribute[1][$i]); $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]);
{
$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; return $attributes;
} }

View File

@@ -174,7 +174,7 @@ if ($show_online)
update_config('most_user_online_ever', $current_online_users . ':' . time()); 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 //before 1.8, styles computability