mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
Admin-ui: Grid mode mostly complete. Fixed admin-ui top navigation.
This commit is contained in:
@@ -441,6 +441,7 @@ define("E_32_TRUE", "<i class='S32 e-true-32'></i>");
|
||||
|
||||
|
||||
define("ADMIN_CHILD_ICON", '<img src="'.e_IMAGE_ABS.'generic/branchbottom.gif" class="treeprefix level-x icon" alt="" />'); // must use single quotes.
|
||||
define("ADMIN_FILTER_ICON", "<i class='fa fa-filter'></i>");
|
||||
define("ADMIN_TRUE_ICON", "<i class='fa fa-check text-success'></i>");
|
||||
define("ADMIN_FALSE_ICON", "<i class='fa fa-times text-danger'></i>");
|
||||
define("ADMIN_WARNING_ICON", "<i class='fa fa-warning text-warning'></i>");
|
||||
|
@@ -3011,6 +3011,7 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
public function setTreeModel($tree_model)
|
||||
{
|
||||
$this->_tree_model = $tree_model;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -5364,6 +5365,7 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
return;
|
||||
}
|
||||
$this->getTreeModel()->setParam('db_query', $this->_modifyListQry(false, false, false, false, $this->listQry))->load();
|
||||
|
||||
$this->addTitle();
|
||||
}
|
||||
|
||||
@@ -6577,6 +6579,10 @@ class e_admin_form_ui extends e_form
|
||||
$perPage = $this->getController()->getPerPage();
|
||||
$fromPage = $this->getController()->getQuery('from', 0);
|
||||
|
||||
$vars = $this->getController()->getQuery();
|
||||
$vars['from'] = '[FROM]';
|
||||
// var_dump($vars);
|
||||
$paginate = http_build_query($vars);
|
||||
|
||||
$text = "
|
||||
<form method='get' action='".e_REQUEST_SELF."'>
|
||||
@@ -6596,8 +6602,8 @@ class e_admin_form_ui extends e_form
|
||||
".$this->select_close()."
|
||||
<div class='e-autocomplete'></div>
|
||||
".implode("\n", $filter_preserve_var)."
|
||||
".$this->admin_button('etrigger_filter', 'etrigger_filter', 'filter e-hide-if-js', LAN_FILTER, array('id' => false))."
|
||||
".$this->pagination(e_REQUEST_SELF.'?from=[FROM]',$totalRecords,$fromPage,$perPage,array('template'=>'basic'))."
|
||||
".$this->admin_button('etrigger_filter', 'etrigger_filter', 'filter e-hide-if-js', ADMIN_FILTER_ICON, array('id' => false,'title'=>LAN_FILTER))."
|
||||
".$this->pagination(e_REQUEST_SELF.'?'.$paginate,$totalRecords,$fromPage,$perPage,array('template'=>'basic'))."
|
||||
<span class='indicator' style='display: none;'>
|
||||
<img src='".e_IMAGE_ABS."generic/loading_16.gif' class='icon action S16' alt='".LAN_LOADING."' />
|
||||
</span>
|
||||
|
@@ -3427,7 +3427,7 @@ class e_parser
|
||||
protected $allowedTags = array('html', 'body','div','a','img','table','tr', 'td', 'th', 'tbody', 'thead', 'colgroup', 'b',
|
||||
'i', 'pre','code', 'strong', 'u', 'em','ul', 'ol', 'li','img','h1','h2','h3','h4','h5','h6','p',
|
||||
'div','pre','section','article', 'blockquote','hgroup','aside','figure','figcaption', 'abbr','span', 'audio', 'video', 'br',
|
||||
'small', 'caption', 'noscript', 'hr', 'section', 'iframe', 'sub', 'sup', 'cite'
|
||||
'small', 'caption', 'noscript', 'hr', 'section', 'iframe', 'sub', 'sup', 'cite', 'ins'
|
||||
);
|
||||
protected $scriptTags = array('script','applet','form','input','button', 'embed', 'object'); //allowed when $pref['post_script'] is enabled.
|
||||
|
||||
|
@@ -3141,7 +3141,7 @@ class e_form
|
||||
|
||||
case 'filter':
|
||||
case 'filter e-hide-if-js':
|
||||
// FIXME hide-js shouldn't be here.
|
||||
$options['class'] = 'btn btn-default';
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4101,13 +4101,13 @@ class e_form
|
||||
|
||||
$editIconDefault = deftrue('ADMIN_EDIT_ICON', $tp->toGlyph('fa-edit'));
|
||||
$deleteIconDefault = deftrue('ADMIN_DELETE_ICON', $tp->toGlyph('fa-trash'));
|
||||
|
||||
/*
|
||||
if($attributes['grid'])
|
||||
{
|
||||
$editIconDefault = $tp->toGlyph('fa-edit');
|
||||
$deleteIconDefault = $tp->toGlyph('fa-trash');
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
$value = "<div class='btn-group'>";
|
||||
|
||||
@@ -4241,6 +4241,7 @@ class e_form
|
||||
//return $this->options($field, $value, $attributes, $id);
|
||||
// consistent method arguments, fixed in admin cron administration
|
||||
$attributes['type'] = null; // prevent infinite loop.
|
||||
|
||||
return $this->options($parms, $value, $id, $attributes);
|
||||
}
|
||||
}
|
||||
@@ -4662,6 +4663,20 @@ class e_form
|
||||
break;
|
||||
|
||||
case 'image': //js tooltip...
|
||||
|
||||
$thparms = array();
|
||||
$createLink = true;
|
||||
|
||||
// Support readParms example: thumb=1&w=200&h=300
|
||||
// Support readParms example: thumb=1&aw=80&ah=30
|
||||
if(isset($parms['h'])) { $thparms['h'] = intval($parms['h']); }
|
||||
if(isset($parms['ah'])) { $thparms['ah'] = intval($parms['ah']); }
|
||||
if(isset($parms['w'])) { $thparms['w'] = intval($parms['w']); }
|
||||
if(isset($parms['aw'])) { $thparms['aw'] = intval($parms['aw']); }
|
||||
if(isset($parms['crop'])) { $thparms['crop'] = $parms['crop']; }
|
||||
|
||||
|
||||
|
||||
if($value)
|
||||
{
|
||||
|
||||
@@ -4693,16 +4708,13 @@ class e_form
|
||||
|
||||
|
||||
|
||||
if(vartrue($parms['thumb']))
|
||||
if(!empty($parms['thumb']))
|
||||
{
|
||||
$thparms = array();
|
||||
|
||||
// Support readParms example: thumb=1&w=200&h=300
|
||||
// Support readParms example: thumb=1&aw=80&ah=30
|
||||
if(isset($parms['h'])) { $thparms['h'] = intval($parms['h']); }
|
||||
if(isset($parms['ah'])) { $thparms['ah'] = intval($parms['ah']); }
|
||||
if(isset($parms['w'])) { $thparms['w'] = intval($parms['w']); }
|
||||
if(isset($parms['aw'])) { $thparms['aw'] = intval($parms['aw']); }
|
||||
|
||||
if(isset($parms['link']) && empty($parms['link']))
|
||||
{
|
||||
$createLink = false;
|
||||
}
|
||||
|
||||
// Support readParms example: thumb=200x300 (wxh)
|
||||
if(strpos($parms['thumb'],'x')!==false)
|
||||
@@ -4728,15 +4740,21 @@ class e_form
|
||||
// return print_a($thparms,true);
|
||||
|
||||
$src = $tp->replaceConstants(vartrue($parms['pre']).$value, 'abs');
|
||||
$thsrc = $tp->thumbUrl(vartrue($parms['pre']).$value, $thparms, varset($parms['thumb_urlraw']));
|
||||
// $thsrc = $tp->thumbUrl(vartrue($parms['pre']).$value, $thparms, varset($parms['thumb_urlraw']));
|
||||
$alt = basename($src);
|
||||
// $ttl = '<img src="'.$thsrc.'" alt="'.$alt.'" class="thumbnail e-thumb" />';
|
||||
|
||||
$thparms['alt'] = $alt;
|
||||
$thparms['class'] = "thumbnail e-thumb";
|
||||
$thparms['class'] = "thumbnail e-thumb img-responsive";
|
||||
|
||||
|
||||
|
||||
$ttl = $tp->toImage($value, $thparms);
|
||||
|
||||
if($createLink === false)
|
||||
{
|
||||
return $ttl;
|
||||
}
|
||||
|
||||
|
||||
$value = '<a href="'.$src.'" data-modal-caption="'.$alt.'" data-target="#uiModal" class="e-modal e-image-preview" title="'.$alt.'" rel="external">'.$ttl.'</a>';
|
||||
@@ -4749,6 +4767,12 @@ class e_form
|
||||
$value = '<a href="'.$src.'" class="e-image-preview" title="'.$alt.'" rel="external">'.defset($ttl, $ttl).'</a>';
|
||||
}
|
||||
}
|
||||
elseif(!empty($parms['fallback']))
|
||||
{
|
||||
$value = $parms['fallback'];
|
||||
$thparms['class'] = "thumbnail e-thumb img-responsive fallback";
|
||||
return $tp->toImage($value, $thparms);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'files':
|
||||
@@ -5697,7 +5721,7 @@ class e_form
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic List Form, used internal by admin UI
|
||||
* Generic List Form, used internally by admin UI
|
||||
* Expected options array format:
|
||||
* <code>
|
||||
* <?php
|
||||
@@ -5840,6 +5864,14 @@ class e_form
|
||||
return (vartrue($options['form_pre']).$text.vartrue($options['form_post']));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render Grid-list layout. used internally by admin UI
|
||||
* @param $form_options
|
||||
* @param $tree_models
|
||||
* @param bool|false $nocontainer
|
||||
* @return string
|
||||
*/
|
||||
public function renderGridForm($form_options, $tree_models, $nocontainer = false)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
@@ -5890,28 +5922,34 @@ class e_form
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
<div class="panel-body">
|
||||
|
||||
</div>*/
|
||||
|
||||
$template = '<div class="panel panel-default">';
|
||||
$template .= '{IMAGE}';
|
||||
$template .= (!empty($options['grid']['body'])) ? '<div class="panel-body">{BODY}</div>' : '';
|
||||
$template .= '<div class="panel-footer clearfix">
|
||||
{CHECKBOX} {TITLE} <span class="pull-right">{OPTIONS}</span>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
||||
if(empty($options['grid']['template']))
|
||||
{
|
||||
$template = '<div class="panel panel-default">
|
||||
<div class="e-overlay" >{IMAGE}
|
||||
<div class="e-overlay-content">
|
||||
{OPTIONS}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">{TITLE}<span class="pull-right">{CHECKBOX}</span></div>
|
||||
</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$template = $options['grid']['template'];
|
||||
}
|
||||
|
||||
|
||||
$cls = !empty($options['grid']['class']) ? $options['grid']['class'] : 'col-md-2';
|
||||
$pid = $options['pid'];
|
||||
|
||||
$gridFields = $options['grid'];
|
||||
$gridFields['options'] = 'options';
|
||||
$gridFields['checkbox'] = 'checkboxes';
|
||||
|
||||
unset($gridFields['class'],$gridFields['perPage']);
|
||||
|
||||
$cls = !empty($options['grid']['class']) ? $options['grid']['class'] : 'col-md-2';
|
||||
$height = !empty($options['grid']['height']) ? $options['grid']['height'] : '220px';
|
||||
$pid = $options['pid'];
|
||||
$title = $options['grid']['title'];
|
||||
$pic = $options['grid']['image'];
|
||||
$body = $options['grid']['body'];
|
||||
$fields['options']['grid'] = true;
|
||||
|
||||
foreach($tree as $model)
|
||||
{
|
||||
@@ -5920,25 +5958,17 @@ class e_form
|
||||
$data = $model->getData();
|
||||
|
||||
$id = $data[$pid];
|
||||
$vars = array();
|
||||
|
||||
$vars = array(
|
||||
'CHECKBOX' => $this->renderValue('checkboxes',$data['checkboxes'],$fields['checkboxes'],$id),
|
||||
'TITLE' => $this->renderValue($title,$data[$title],$fields[$title],$id),
|
||||
'IMAGE' => $this->renderValue($pic,$data[$pic],$fields[$pic],$id),
|
||||
'OPTIONS' => $this->renderValue('options',$data['options'], $fields['options'], $id)
|
||||
);
|
||||
|
||||
if(!empty($options['grid']['body']))
|
||||
foreach($gridFields as $k=>$v)
|
||||
{
|
||||
$vars['BODY'] = $this->renderValue($body,$data[$body],$fields[$body],$id);
|
||||
$key = strtoupper($k);
|
||||
$fields[$v]['grid'] = true;
|
||||
$vars[$key] = $this->renderValue($v,$data[$v],$fields[$v],$id);
|
||||
}
|
||||
|
||||
$text .= "<div class='".$cls." admin-grid' style='height:".$height.";overflow:hidden;margin-bottom:2em'>";
|
||||
|
||||
$text .= "<div class='".$cls." admin-ui-grid'>";
|
||||
$text .= $tp->simpleParse($template,$vars);
|
||||
|
||||
|
||||
// $text .= $this->renderTableRow($fields, $current_fields, $model->getData(), $options['pid']);
|
||||
$text .= "</div>";
|
||||
|
||||
}
|
||||
@@ -5959,6 +5989,7 @@ class e_form
|
||||
$parms = 'total='.$total;
|
||||
$parms .= '&amount='.$amount;
|
||||
$parms .= '¤t='.$from;
|
||||
|
||||
if(ADMIN_AREA)
|
||||
{
|
||||
$parms .= '&tmpl_prefix=admin';
|
||||
|
@@ -59,6 +59,30 @@ a.core-mainpanel-link-icon:hover { text-decoration: none; filter: none; }
|
||||
|
||||
#admin-ui-nav-menu li.divider { padding-top: 10px; border-bottom: 1px outset #262626; margin-bottom: 10px; }
|
||||
|
||||
|
||||
|
||||
/* e-overlay */
|
||||
.e-overlay { position: relative; height: 100%; }
|
||||
.e-overlay .e-overlay-content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; color: #FFF; opacity: 0; }
|
||||
.e-overlay:hover .e-overlay-content { opacity: 1; padding-top:33%; transition: opacity .20s ease-in-out;
|
||||
-moz-transition: opacity .20s ease-in-out;
|
||||
-webkit-transition: opacity .20s ease-in-out;
|
||||
vertical-align: middle;
|
||||
background: rgba(0, 0, 0, .7);
|
||||
text-align:center;
|
||||
}
|
||||
.e-overlay .thumbnail { margin:0; }
|
||||
|
||||
.admin-ui-grid img.fallback { opacity: 0.3; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* TODO - use col-xx-x markup where core-mainpanel-block occurs. ? */
|
||||
@media (max-width: 1700px){
|
||||
.core-mainpanel-block { width:25%; }
|
||||
|
Reference in New Issue
Block a user