2006-12-02 04:36:16 +00:00
< ? php
/*
2009-11-18 02:07:15 +00:00
* e107 website system
*
2013-02-27 17:18:33 +01:00
* Copyright ( C ) 2008 - 2013 e107 Inc ( e107 . org )
2009-11-18 02:07:15 +00:00
* Released under the terms and conditions of the
* GNU General Public License ( http :// www . gnu . org / licenses / gpl . txt )
*
*/
2009-08-19 14:39:57 +00:00
if ( isset ( $_GET [ 'configure' ]))
{
//Switch to Front-end
define ( " USER_AREA " , true );
//Switch to desired layout
define ( 'THEME_LAYOUT' , $_GET [ 'configure' ]);
}
2006-12-02 04:36:16 +00:00
require_once ( " ../class2.php " );
2009-01-21 22:04:36 +00:00
if ( ! getperms ( " 2 " ))
2008-12-08 22:21:29 +00:00
{
2006-12-02 04:36:16 +00:00
header ( " location: " . e_BASE . " index.php " );
exit ;
}
2009-08-28 16:11:02 +00:00
2012-05-04 17:56:21 +00:00
//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
e107 :: coreLan ( 'menus' , true );
e107 :: coreLan ( 'admin' , true );
2009-08-28 16:11:02 +00:00
2012-12-04 16:27:58 +02:00
// FIXME - quick temporarry fix for missing icons on menu administration. We need different core style to be included (forced) here - e.g. e107_web/css/admin/sprite.css
2012-12-17 13:21:43 -08:00
if ( e_IFRAME ) //<-- Check config and delete buttons if modifying
2012-12-04 16:27:58 +02:00
{
2012-12-17 13:21:43 -08:00
//e107::js('core','bootstrap/js/bootstrap.min.js');
//e107::css('core','bootstrap/css/bootstrap.min.css');
2012-12-04 16:27:58 +02:00
e107 :: css ( 'url' , '{e_THEME}/bootstrap/admin_style.css' );
2012-12-17 13:21:43 -08:00
2012-12-04 16:27:58 +02:00
}
2013-03-02 21:07:42 -08:00
if ( strpos ( e_QUERY , 'configure' ) !== FALSE || vartrue ( $_GET [ 'enc' ]))
2012-05-24 15:54:25 +00:00
{
2012-12-17 13:21:43 -08:00
//e107::js('core', 'colorbox/jquery.colorbox-min.js', 'jquery', 2);
//e107::css('core', 'colorbox/colorbox.css', 'jquery');
2012-05-24 15:54:25 +00:00
2012-12-17 13:21:43 -08:00
//e107::js('core', 'core/jquery.elastic.source.js', 'jquery', 2);
2012-05-24 15:54:25 +00:00
2012-12-17 13:21:43 -08:00
//e107::js('core', 'plupload/plupload.full.js', 'jquery', 2);
//e107::css('core', 'plupload/jquery.plupload.queue/css/jquery.plupload.queue.css', 'jquery');
//e107::js('core', 'plupload/jquery.plupload.queue/jquery.plupload.queue.js', 'jquery', 2);
2012-05-24 15:54:25 +00:00
2012-12-17 13:21:43 -08:00
//e107::css('core', 'chosen/chosen.css', 'jquery');
//e107::js('core', 'chosen/chosen.jquery.min.js', 'jquery', 2);
2012-05-24 15:54:25 +00:00
2012-12-17 13:21:43 -08:00
//e107::css('core', 'password/style.css', 'jquery');
//e107::js('core', 'password/jquery.pwdMeter.js', 'jquery', 2);
2012-05-24 15:54:25 +00:00
//
2012-12-17 13:21:43 -08:00
//e107::js("core", "plupload/customUpload.js","jquery",3);
2012-05-24 15:54:25 +00:00
2012-12-17 13:21:43 -08:00
//e107::js("core", "core/mediaManager.js","jquery",3);
2012-05-24 15:54:25 +00:00
2012-12-17 13:21:43 -08:00
// e107::css('core', 'core/admin.css', 'jquery');
2013-03-02 21:07:42 -08:00
// e107::js('core', 'core/admin.jquery.js', 'jquery', 4);
2013-03-03 01:24:54 -08:00
e107 :: js ( 'core' , 'bootstrap/js/bootstrap-tooltip.js' );
2013-03-02 21:07:42 -08:00
// e107::css('core','bootstrap/css/bootstrap.min.css');
e107 :: js ( 'inline' , "
$ ( function () {
// Visibility Options
$ ( '.e-menumanager-option' ) . on ( 'click' , function (){
var link = $ ( this ) . attr ( 'href' );
2013-03-03 04:46:57 -08:00
var caption = $ ( this ) . attr ( 'data-modal-caption' );
2013-03-02 21:07:42 -08:00
window . parent . $ ( '#uiModal .modal-caption' ) . text ( caption );
window . parent . $ ( '#uiModal .modal-body' ) . load ( link , function (){
window . parent . $ ( '.modal-body .e-save' ) . on ( 'change' , function (){
var target = window . parent . $ ( '#e-save-form' ) . attr ( 'action' );
var data = window . parent . $ ( '#e-save-form' ) . serialize ();
$ . post ( target , data , function ( ret )
{
var a = $ . parseJSON ( ret );
if ( a . error )
{
alert ( a . msg );
}
});
});
});
window . parent . $ ( '#uiModal' ) . modal ( 'show' );
return false ;
}) ;
// Delete Button (Remove Menu) Function
$ ( '.e-menumanager-delete' ) . on ( 'click' , function ( e ){
e . preventDefault ();
var area = 'remove' ;
var remove = $ ( this ) . attr ( 'id' );
var opt = remove . split ( '-' );
var hidem = '#block-' + opt [ 1 ] + '-' + opt [ 2 ];
$ ( hidem ) . hide ( 'slow' );
// alert(hidem);
$ . ajax ({
type : 'POST' ,
url : 'menus.php' ,
data : { removeid : remove , area : area , mode : 'delete' }
}) . done ( function ( data ) {
var a = $ . parseJSON ( data );
if ( a . error )
{
alert ( a . msg );
}
});
});
});
" );
2012-05-24 15:54:25 +00:00
2012-06-03 01:42:05 +00:00
e107 :: css ( 'inline' , " .column { width:100%; padding-bottom: 100px; }
2013-03-03 12:23:59 -08:00
2013-04-14 18:41:53 -07:00
2013-04-14 17:06:02 -07:00
. regularMenu { border - bottom : 1 px dotted silver ; margin - bottom : 6 px ; padding - left : 3 px ; padding - right : 3 px ; padding - bottom : 20 px }
2013-04-14 18:41:53 -07:00
#core-menumanager-main th {color: silver; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:14px; font-weight: bold; line-height:24px; background-color:#2F2F2F }
2012-05-24 15:54:25 +00:00
. portlet { margin : 0 1 em 1 em 0 ; }
. portlet - header { margin : 0.3 em ; padding - bottom : 4 px ; padding - left : 0.2 em ; cursor : move }
. portlet - header . ui - icon { float : right ; }
2012-06-03 01:42:05 +00:00
. portlet - content { padding : 7 px ; }
2012-05-24 15:54:25 +00:00
. ui - sortable - placeholder { border : 1 px dotted black ; visibility : visible ! important ; height : 50 px ! important ; }
. ui - sortable - placeholder * { visibility : hidden ; }
2013-03-02 21:07:42 -08:00
2013-04-14 19:28:15 -07:00
[ class ^= 'icon-' ], [ class *= ' icon-' ] {
display : inline - block ;
width : 14 px ;
height : 14 px ;
margin - top : 1 px ;
line - height : 14 px ;
vertical - align : text - top ;
background - image : url ( '".e_JS."bootstrap/img/glyphicons-halflings.png' );
background - position : 14 px 14 px ;
background - repeat : no - repeat ;
}
2013-03-02 21:07:42 -08:00
2013-04-14 19:28:15 -07:00
. icon - search {
background - position : - 48 px 0 ;
}
2013-03-02 21:07:42 -08:00
/* A little bit of bootstrap styling - loading /bootstrap.css could break some themes */
. menu - btn {
display : inline - block ;
padding : 4 px 12 px ;
margin - bottom : 0 px ;
font - size : 14 px ;
line - height : 20 px ;
color : rgb ( 51 , 51 , 51 );
text - align : center ;
text - shadow : 0 px 1 px 1 px rgba ( 255 , 255 , 255 , 0.75 );
vertical - align : middle ;
cursor : pointer ;
background - color : rgb ( 245 , 245 , 245 );
background - image : linear - gradient ( to bottom , rgb ( 255 , 255 , 255 ), rgb ( 230 , 230 , 230 ));
background - repeat : repeat - x ;
border - width : 1 px ;
border - style : solid ;
- moz - border - top - colors : none ;
- moz - border - right - colors : none ;
- moz - border - bottom - colors : none ;
- moz - border - left - colors : none ;
border - image : none ;
border - color : rgba ( 0 , 0 , 0 , 0.1 ) rgba ( 0 , 0 , 0 , 0.1 ) rgb ( 179 , 179 , 179 );
border - radius : 4 px 4 px 4 px 4 px ;
box - shadow : 0 px 1 px 0 px rgba ( 255 , 255 , 255 , 0.2 ) inset , 0 px 1 px 2 px rgba ( 0 , 0 , 0 , 0.05 );
}
. menu - btn : hover , . menu - btn : focus , . menu - btn : active , . menu - btn . active , . menu - btn . disabled , . menu - btn [ disabled ] {
color : rgb ( 51 , 51 , 51 );
background - color : rgb ( 230 , 230 , 230 );
}
. menu - btn : hover , . menu - btn : focus {
color : rgb ( 51 , 51 , 51 );
text - decoration : none ;
background - position : 0 px - 15 px ;
transition : background - position 0.1 s linear 0 s ;
}
. menu - btn - primary {
color : rgb ( 255 , 255 , 255 );
text - shadow : 0 px - 1 px 0 px rgba ( 0 , 0 , 0 , 0.25 );
background - color : rgb ( 0 , 109 , 204 );
background - image : linear - gradient ( to bottom , rgb ( 0 , 136 , 204 ), rgb ( 0 , 68 , 204 ));
background - repeat : repeat - x ;
border - color : rgba ( 0 , 0 , 0 , 0.1 ) rgba ( 0 , 0 , 0 , 0.1 ) rgba ( 0 , 0 , 0 , 0.25 );
}
. tbox { text - align : left }
. menuOptions {
2013-04-14 19:28:15 -07:00
padding - top : 7 px ;
padding - right : 5 px ;
text - align : left ;
opacity : 0 ;
transition : opacity . 25 s ease - in - out ;
- moz - transition : opacity . 25 s ease - in - out ;
- webkit - transition : opacity . 25 s ease - in - out ;
2013-03-03 04:46:57 -08:00
2013-03-02 21:07:42 -08:00
}
2013-04-14 19:28:15 -07:00
. menuOptions : hover {
opacity : 1 ;
}
2013-03-03 04:46:57 -08:00
. menu - options - buttons { white - space : nowrap }
#menu-manage-actions { width:50%; vertical-align:top; text-align:center; padding:15px }
2013-03-02 21:07:42 -08:00
select . menu - btn { text - align : left }
2013-04-14 18:41:53 -07:00
2013-03-02 21:07:42 -08:00
2013-04-14 18:41:53 -07:00
label { font - family : 'Helvetica Neue' , Helvetica , Arial , sans - serif ; color : black ; line - height : 14 px }
label . input { margin - right : 10 px ; }
2013-03-02 21:07:42 -08:00
2013-03-03 01:24:54 -08:00
#core-menumanager-main { width:100%; margin-left:auto; margin-right:auto }
2013-03-02 21:07:42 -08:00
2013-03-03 01:24:54 -08:00
table . table { width : 95 % ; margin - left : auto ; margin - right : auto ; }
2013-03-02 21:07:42 -08:00
2013-03-03 01:24:54 -08:00
label . selection - row { padding : 6 px ; cursor : pointer ; width : 90 % }
table . table tbody > tr > td { }
2013-03-06 23:01:16 -08:00
table . table tbody > tr > td label {
display : block ;
cursor : pointer ;
font - size : 14 px ;
line - height : 2 em ;
padding - left : 15 px ;
2013-04-14 18:41:53 -07:00
font - family : 'Helvetica Neue' , Helvetica , Arial , sans - serif ;
color : black ;
2013-03-06 23:01:16 -08:00
}
2013-04-14 18:41:53 -07:00
table . table tbody > tr > td label > input { margin - left : 5 px ; margin - right : 10 px ; float : left ; }
2013-03-02 21:07:42 -08:00
. table - striped tbody > tr : nth - child ( 2 n + 1 ) > td , . table - striped tbody > tr : nth - child ( 2 n + 1 ) > th {
background - color : rgb ( 249 , 249 , 249 );
}
2013-03-03 01:24:54 -08:00
. menu - panel {
min - height : 20 px ;
padding : 19 px ;
margin - bottom : 20 px ;
background - color : rgb ( 245 , 245 , 245 );
border : 1 px solid rgb ( 227 , 227 , 227 );
2013-04-14 18:41:53 -07:00
border - radius : 5 px ;
2013-03-03 01:24:54 -08:00
box - shadow : 0 px 1 px 1 px rgba ( 0 , 0 , 0 , 0.05 ) inset ;
2013-04-14 18:41:53 -07:00
color : #2F2F2F;
font - size : 13 px ;
font - family : 'Helvetica Neue' , Helvetica , Arial , sans - serif ;
2013-03-03 01:24:54 -08:00
}
. menu - panel - header
{
2013-04-14 17:06:02 -07:00
display : block ;
padding : 10 px ;
font - size : 13 px ;
font - weight : bold ;
2013-04-14 18:41:53 -07:00
font - family : 'Helvetica Neue' , Helvetica , Arial , sans - serif ;
2013-04-14 17:06:02 -07:00
line - height : 20 px ;
border - radius : 5 px ;
text - transform : uppercase ;
margin - bottom : 10 px ;
background - color : rgb ( 0 , 136 , 204 );
color : white ;
2013-03-03 01:24:54 -08:00
}
2012-05-24 15:54:25 +00:00
" ,'jquery');
}
2006-12-02 04:36:16 +00:00
$e_sub_cat = 'menus' ;
2009-07-10 14:27:31 +00:00
2006-12-02 04:36:16 +00:00
require_once ( e_HANDLER . " file_class.php " );
2009-08-16 16:30:56 +00:00
require_once ( e_HANDLER . " menumanager_class.php " );
2009-07-16 02:55:19 +00:00
2013-02-27 17:18:33 +01:00
$rs = new form ;
$frm = e107 :: getForm ();
$men = new e_menuManager ( 0 ); // use 1 for dragdrop.
$mes = e107 :: getMessage ();
2006-12-02 04:36:16 +00:00
2009-08-19 14:39:57 +00:00
if ( e_AJAX_REQUEST )
{
2013-03-02 21:07:42 -08:00
if ( vartrue ( $_GET [ 'enc' ]))
{
$string = base64_decode ( $_GET [ 'enc' ]);
parse_str ( $string , $_GET );
// print_a($_GET);
}
// print_a($_POST);
if ( vartrue ( $_GET [ 'vis' ]))
{
$text = $men -> menuVisibilityOptions ();
}
// print_a($_GET);
if ( vartrue ( $_GET [ 'parmsId' ]))
{
$text = $men -> menuInstanceParameters ();
}
if ( vartrue ( $_POST [ 'mode' ]))
{
// print_r($_POST);
// $men->setMenuId($this->menuId);
$text = $men -> menuSaveAjax ( $_POST [ 'mode' ]);
}
echo $text ;
2009-07-10 14:27:31 +00:00
exit ;
2013-03-02 21:07:42 -08:00
2009-08-19 14:39:57 +00:00
}
2009-07-09 08:31:38 +00:00
2012-05-24 16:11:26 +00:00
if ( isset ( $_GET [ 'configure' ]) || isset ( $_GET [ 'iframe' ]))
2009-08-19 14:39:57 +00:00
{
//No layout parse when in iframe mod
define ( 'e_IFRAME' , true );
}
2009-07-09 11:37:36 +00:00
2009-08-19 14:39:57 +00:00
require_once ( " auth.php " );
2009-07-09 11:37:36 +00:00
2009-07-10 14:27:31 +00:00
if ( $_POST )
{
$e107cache -> clear_sys ( " menus_ " );
}
2009-07-09 11:37:36 +00:00
2013-02-27 17:18:33 +01:00
//FIXME still used in e_HANDLER.menumanager_class.php
2012-12-08 15:52:40 +01:00
if ( vartrue ( $message ) != " " )
2009-07-10 14:27:31 +00:00
{
echo $ns -> tablerender ( 'Updated' , " <div style='text-align:center'><b> " . $message . " </b></div><br /><br /> " );
}
2009-07-09 11:37:36 +00:00
2009-08-19 14:39:57 +00:00
//BC - configure and dot delimiter deprecated
if ( ! isset ( $_GET [ 'configure' ]))
2009-07-09 11:37:36 +00:00
{
2009-07-17 02:28:49 +00:00
$men -> menuScanMenus ();
2012-12-08 15:52:40 +01:00
$text = $men -> menuRenderMessage ();
2009-07-11 01:48:40 +00:00
$text .= $men -> menuSelectLayout ();
$text .= $men -> menuVisibilityOptions ();
2012-05-04 17:56:21 +00:00
$text .= $men -> menuInstanceParameters ();
2009-07-11 01:48:40 +00:00
$text .= $men -> menuRenderIframe ();
2013-02-22 21:34:06 -08:00
$ns -> tablerender ( ADLAN_6 . SEP . LAN_MENULAYOUT , $text , 'menus_config' );
2009-07-09 11:37:36 +00:00
}
2009-07-10 14:27:31 +00:00
else // Within the IFrame.
{
$men -> menuRenderPage ();
2009-07-09 08:31:38 +00:00
2009-07-10 14:27:31 +00:00
}
2009-07-09 08:31:38 +00:00
2009-07-10 14:27:31 +00:00
// -----------------------------------------------------------------------------
2009-07-09 08:31:38 +00:00
2006-12-02 04:36:16 +00:00
require_once ( " footer.php " );
2009-07-07 12:54:47 +00:00
2009-07-10 14:27:31 +00:00
// -----------------------------------------------------------------------
2009-07-07 12:54:47 +00:00
2009-07-12 10:11:35 +00:00
function menus_adminmenu ()
{
2009-07-15 09:38:00 +00:00
// See admin_shortcodes_class.php - get_admin_menumanager()
// required there so it can be shared by plugins.
2009-07-10 14:27:31 +00:00
}
2009-07-12 10:11:35 +00:00
2006-12-02 04:36:16 +00:00
?>