mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Custom Menus 'grid' view added. Admin theme stylesheets relabeled as "Skins"
This commit is contained in:
parent
39b4265c17
commit
50ff6736a3
@ -84,6 +84,7 @@ class page_admin extends e_admin_dispatcher
|
||||
'overview/edit' => 'overview/list',
|
||||
'page/edit' => 'page/list',
|
||||
'menu/edit' => 'menu/create',
|
||||
'menu/grid' => 'menu/list',
|
||||
'cat/edit' => 'cat/list'
|
||||
);
|
||||
|
||||
@ -552,7 +553,13 @@ class page_admin_ui extends e_admin_ui
|
||||
protected $url = array('route'=>'page/view/index', 'vars' => array('id' => 'page_id', 'name' => 'page_sef', 'other' => 'page_sef', 'chapter' => 'chapter_sef', 'book' => 'book_sef'), 'name' => 'page_title', 'description' => ''); // 'link' only needed if profile not provided.
|
||||
protected $tabs = array(CUSLAN_59,CUSLAN_60,CUSLAN_61,CUSLAN_62);
|
||||
protected $featurebox = array('name'=>'page_title', 'description'=>'page_text', 'image' => 'menu_image', 'visibility' => 'page_class', 'url' => true);
|
||||
|
||||
|
||||
|
||||
protected $grid = array('title'=>'menu_title', 'image'=>'menu_image', 'body'=>'', 'class'=>'col-md-2', 'perPage'=>12, 'carousel'=>false);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 'fb_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left'),
|
||||
'fb_text' => array('title'=> FBLAN_08, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1','writeParms'=>'template=admin'),
|
||||
@ -633,7 +640,15 @@ class page_admin_ui extends e_admin_ui
|
||||
function init()
|
||||
{
|
||||
|
||||
if($this->getMode() === 'overview')
|
||||
$mode = $this->getMode();
|
||||
|
||||
|
||||
if($mode !== 'menu')
|
||||
{
|
||||
$this->grid = array();
|
||||
}
|
||||
|
||||
if($mode === 'overview')
|
||||
{
|
||||
$this->listQry = "SELECT SQL_CALC_FOUND_ROWS p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id "; // without any Order or Limit.
|
||||
$this->fieldpref = array("page_id", "page_title", 'page_chapter', 'page_template', "menu_title", 'menu_image', 'menu_template' );
|
||||
@ -684,11 +699,11 @@ class page_admin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
// USED IN Menu LIST/INLINE-EDIT MODE ONLY.
|
||||
if($this->getMode() === 'menu' && ($this->getAction() == 'list' || $this->getAction() == 'inline'))
|
||||
if($this->getMode() === 'menu' && ($this->getAction() == 'list' || $this->getAction() == 'inline' || $this->getAction() == 'grid'))
|
||||
{
|
||||
|
||||
$this->listQry = "SELECT SQL_CALC_FOUND_ROWS p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id WHERE (p.menu_name != '' OR p.menu_image != '' OR p.menu_icon !='') "; // without any Order or Limit.
|
||||
|
||||
// $this->gridQry = $this->listQry;
|
||||
$this->listOrder = 'p.page_order asc'; // 'p.page_id desc';
|
||||
|
||||
$this->batchDelete = false;
|
||||
@ -724,7 +739,11 @@ class page_admin_ui extends e_admin_ui
|
||||
$this->fields['menu_name']['inline'] = true;
|
||||
}
|
||||
|
||||
if($this->getAction() == 'grid')
|
||||
{
|
||||
$this->fields['menu_image']['readParms'] = 'thumb=400x400';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -4741,8 +4741,12 @@ class e_form
|
||||
$value = $tmp[0];
|
||||
unset($tmp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(empty($parms['thumb_aw']) && !empty($parms['thumb']) && strpos($parms['thumb'],'x')!==false)
|
||||
{
|
||||
list($parms['thumb_aw'],$parms['thumb_ah']) = explode('x',$parms['thumb']);
|
||||
}
|
||||
|
||||
$vparm = array('thumb'=>'tag','w'=> vartrue($parms['thumb_aw'],'80'));
|
||||
|
||||
if($video = e107::getParser()->toVideo($value,$vparm))
|
||||
|
@ -2354,8 +2354,10 @@ class themeHandler
|
||||
|
||||
if(array_key_exists("multipleStylesheets", $theme) && $mode && !empty($theme['css']))
|
||||
{
|
||||
$pLabel = (self::RENDER_ADMINPREFS === $mode) ? TPVLAN_95 : TPVLAN_22;
|
||||
|
||||
$text .= "
|
||||
<tr><td style='vertical-align:top;'><b>".TPVLAN_22.":</b></td>
|
||||
<tr><td style='vertical-align:top;'><b>".$pLabel.":</b></td>
|
||||
<td colspan='2' style='vertical-align:top'>
|
||||
<table class='table table-bordered table-striped' >
|
||||
<tr>
|
||||
|
@ -129,4 +129,5 @@ define("TPVLAN_92", "New Theme Folder");
|
||||
|
||||
define("TPVLAN_93", "Selection");
|
||||
define("TPVLAN_94", "Site theme changed to [x].");
|
||||
define("TPVLAN_95", "Skin");
|
||||
|
||||
|
@ -83,7 +83,9 @@ class plugin_gallery_admin extends e_admin_dispatcher
|
||||
* @var array
|
||||
*/
|
||||
protected $adminMenu = array(
|
||||
'main/prefs' => array('caption' => LAN_PREFS, 'perm' => 'P')
|
||||
'main/prefs' => array('caption' => LAN_PREFS, 'perm' => 'P'),
|
||||
'main/list' => array('caption' => LAN_CATEGORIES, 'perm' => 'P'),
|
||||
'main/create' => array('caption' => LAN_CREATE, 'perm' => 'P'),
|
||||
);
|
||||
|
||||
/**
|
||||
@ -98,6 +100,7 @@ class plugin_gallery_admin extends e_admin_dispatcher
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
|
||||
if(E107_DEBUG_LEVEL > 0)
|
||||
{
|
||||
$this->adminMenu['main/list'] = array(
|
||||
@ -214,6 +217,7 @@ class gallery_cat_admin_ui extends e_admin_ui
|
||||
'width' => 'auto',
|
||||
'thclass' => 'left',
|
||||
'readonly' => false,
|
||||
'inline' => true,
|
||||
),
|
||||
'media_cat_sef' => array(
|
||||
'title' => LAN_SEFURL,
|
||||
@ -538,6 +542,8 @@ class gallery_cat_admin_ui extends e_admin_ui
|
||||
),
|
||||
);
|
||||
|
||||
private $ownerCount;
|
||||
|
||||
/**
|
||||
* Initial function.
|
||||
*/
|
||||
@ -571,24 +577,76 @@ class gallery_cat_admin_ui extends e_admin_ui
|
||||
|
||||
$message = $tp->lanVars(LAN_GALLERY_ADMIN_01, array($x, $y), true);
|
||||
$mes->addInfo($message);
|
||||
|
||||
$this->setGalleryCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* User defined pre-create logic, return false to prevent DB query execution.
|
||||
*
|
||||
* @param $new_data
|
||||
* Posted data.
|
||||
* @param $old_data
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
|
||||
|
||||
function setGalleryCount()
|
||||
{
|
||||
|
||||
$sql = e107::getDb();
|
||||
|
||||
if($sql->gen("SELECT media_cat_owner, MAX(CAST(SUBSTRING_INDEX(media_cat_category, '_', -1 ) AS UNSIGNED)) as maxnum, count(media_cat_id) as number FROM `#core_media_cat` GROUP BY media_cat_owner"))
|
||||
{
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$this->ownerCount[$row['media_cat_owner']] = $row['number'];
|
||||
$own = $row['media_cat_owner'];
|
||||
// if(!in_array($own,$this->restricted))
|
||||
{
|
||||
// $this->fields['media_cat_owner']['writeParms'][$own] = $own;
|
||||
|
||||
if($row['maxnum'] > 0)
|
||||
{
|
||||
$this->ownerCount[$row['media_cat_owner']] = $row['maxnum']; // $maxnum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
e107::getMessage()->addDebug("Max value for category names: ".print_a($this->ownerCount,true));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function beforeCreate($new_data, $old_data)
|
||||
{
|
||||
$replace = array("_", " ", "'", '"', "."); // FIXME Improve.
|
||||
$new_data['media_cat_category'] = strtolower(str_replace($replace, "", $new_data['media_cat_title']));
|
||||
$new_data = $this->setCategory($new_data);
|
||||
|
||||
return $new_data;
|
||||
}
|
||||
|
||||
|
||||
public function beforeUpdate($new_data, $old_data, $id)
|
||||
{
|
||||
// $new_data = $this->setCategory($new_data);
|
||||
|
||||
return $new_data;
|
||||
}
|
||||
|
||||
private function setCategory($new_data)
|
||||
{
|
||||
$type = 'image_';
|
||||
|
||||
$increment = ($this->ownerCount['gallery'] +1);
|
||||
|
||||
$new_data['media_cat_owner'] = 'gallery';
|
||||
$new_data['media_cat_category'] = 'gallery_'.$type.$increment;
|
||||
|
||||
if(empty($new_data['media_cat_sef']))
|
||||
{
|
||||
$new_data['media_cat_sef'] = eHelper::title2sef($new_data['media_cat_title']);
|
||||
}
|
||||
|
||||
return $new_data;
|
||||
}
|
||||
|
||||
|
||||
function galleryPage()
|
||||
{
|
||||
$mes = e107::getMessage();
|
||||
|
@ -24,7 +24,7 @@
|
||||
</libraries>
|
||||
<stylesheets>
|
||||
<css file="style.css" name="Default"/>
|
||||
<css file="css/bootstrap-dark.min.css" name="Bootstrap3 Dark Admin" description="" thumbnail='' scope='admin' exclude='bootstrap'/>
|
||||
<css file="css/bootstrap-dark.min.css" name="Dark Admin" description="" thumbnail='' scope='admin' exclude='bootstrap'/>
|
||||
<css file="css/kadmin.css" name="K-Admin Inspired" scope='admin' description="(experimental)" thumbnail='' url='http://themifycloud.com/demos/templates/KAdmin/KAdmin-Dark/dashboard.html' />
|
||||
<css file="css/corporate.css" name="Corporate" scope='admin' exclude='bootstrap' />
|
||||
<css file="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css" name="Flatly" scope='admin' exclude='bootstrap'/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user