1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Code cleanup

This commit is contained in:
Cameron
2015-04-01 23:01:04 -07:00
parent bacee553bc
commit b7e6837e34
5 changed files with 37 additions and 27 deletions

View File

@@ -1348,7 +1348,7 @@ if($_POST)
$text .= $men->menuVisibilityOptions(); $text .= $men->menuVisibilityOptions();
$text .= $men->menuInstanceParameters(); $text .= $men->menuInstanceParameters();
$text .= $men->menuRenderIframe(); $text .= $men->menuRenderIframe();
$ns -> tablerender(ADLAN_6.SEP.LAN_MENULAYOUT, $text, 'menus_config'); $ns -> tablerender(ADLAN_6.SEP.LAN_MENULAYOUT, e107::getMessage()->render(). $text, 'menus_config');
} }
else // Within the IFrame. else // Within the IFrame.
{ {
@@ -1407,7 +1407,7 @@ require_once("footer.php");
function menus_adminmenu() function menus_adminmenu()
{ {
// See admin_shortcodes_class.php - get_admin_menumanager() // See admin_shortcodes.php - sc_admin_menumanager()
// required there so it can be shared by plugins. // required there so it can be shared by plugins.
} }

View File

@@ -1594,37 +1594,51 @@ class e_menuManager {
function menuSetConfigList() function menuSetConfigList()
{ {
e107::getMessage()->addDebug("Scanning for Menu config files");
$sql = e107::getDb(); $sql = e107::getDb();
$pref = e107::getPref(); $pref = e107::getPref();
$prev_name = '';
$search = array('_menu','_');
$sql -> select("menus", "*", "menu_location != 0 ORDER BY menu_path,menu_name"); $sql -> select("menus", "*", "menu_location != 0 ORDER BY menu_path,menu_name");
while($row = $sql-> fetch()) while($row = $sql-> fetch())
{ {
$link = ""; $link = "";
extract($row); $id = substr($row['menu_path'],0,-1);
$id = substr($menu_path,0,-1);
if (file_exists(e_PLUGIN."{$menu_path}{$menu_name}_menu_config.php")) if (file_exists(e_PLUGIN."{$row['menu_path']}{$row['menu_name']}_menu_config.php"))
{ {
$link = "{$menu_path}{$menu_name}_menu_config.php"; $link = $row['menu_path'].$row['menu_name']."_menu_config.php";
} }
if(file_exists(e_PLUGIN."{$menu_path}config.php")) if($row['menu_path'] == 'news/')
{ {
$link = "{$menu_path}config.php"; $row['menu_path'] = "blogcalendar_menu/";
} }
if(file_exists(e_PLUGIN.$row['menu_path']."config.php"))
{
$link = $row['menu_path']."config.php";
}
if($link) if($link)
{ {
$tmp[$id]['name'] = ucwords(str_replace("_menu","",$menu_name));
if(vartrue($prev) == $id && ($tmp[$id]['name']!=$prev_name))
$tmp[$id]['name'] = ucwords(str_replace($search,"",$row['menu_name'])); // remove _
if(vartrue($prev) == $id && ($tmp[$id]['name'] != $prev_name))
{ {
$tmp[$id]['name'] .= ":".$prev_name; $tmp[$id]['name'] .= ":".$prev_name;
} }
$tmp[$id]['link'] = $link; $tmp[$id]['link'] = $link;
$prev = $id; $prev = $id;
$prev_name = $tmp[$id]['name']; $prev_name = $tmp[$id]['name'];
} }
} }
@@ -1632,6 +1646,6 @@ class e_menuManager {
$pref['menuconfig_list'] = vartrue($tmp); $pref['menuconfig_list'] = vartrue($tmp);
e107::getConfig()->setPref($pref)->save(false,true,false); e107::getConfig()->setPref($pref)->save(false,true,false);
// save_prefs();
} }
} // end of Class. } // end of Class.

View File

@@ -35,8 +35,8 @@ $marray = e107::getDate()->terms('month');
// if nr of rows per month is not set, default to 3 // if nr of rows per month is not set, default to 3
$months_per_row = $pref['blogcal_mpr']?$pref['blogcal_mpr']: $months_per_row = (!empty($pref['blogcal_mpr'])) ? $pref['blogcal_mpr']: "3";
"3";
$pref['blogcal_ws'] = "monday"; $pref['blogcal_ws'] = "monday";
// ------------------------------------- // -------------------------------------

View File

@@ -24,20 +24,13 @@ require_once(e_ADMIN."auth.php");
$frm = e107::getForm(); $frm = e107::getForm();
$mes = e107::getMessage(); $mes = e107::getMessage();
if (isset($_POST['update_menu'])) if(!empty($_POST['update_menu']))
{ {
$temp = array(); $cfg = e107::getConfig();
while (list($key, $value) = each($_POST)) $cfg->set('blogcal_mpr', intval($_POST['blogcal_mpr']));
{ $cfg->set('blogcal_padding', intval($_POST['blogcal_padding']));
if ($value != LAN_UPDATE) // ??? $cfg->save(true,true,true);
{
$temp[$key] = $value;
}
}
if ($admin_log->logArrayDiffs($temp,$pref,'MISC_06'))
{
save_prefs();
}
} }
$ns->tablerender($caption, $mes->render() . $text); $ns->tablerender($caption, $mes->render() . $text);

View File

@@ -11,6 +11,7 @@
*/ */
require_once('../../class2.php'); require_once('../../class2.php');
if (!getperms('P') || !e107::isInstalled('log')) if (!getperms('P') || !e107::isInstalled('log'))
{ {
header('Location: '.e_BASE.'index.php'); header('Location: '.e_BASE.'index.php');
@@ -19,6 +20,7 @@ if (!getperms('P') || !e107::isInstalled('log'))
require_once(e_ADMIN.'auth.php'); require_once(e_ADMIN.'auth.php');
require_once(e_HANDLER.'userclass_class.php'); require_once(e_HANDLER.'userclass_class.php');
$frm = e107::getForm(); $frm = e107::getForm();
$mes = e107::getMessage(); $mes = e107::getMessage();
@@ -240,7 +242,7 @@ if (isset($_POST['updatesettings']))
e107::getLog()->add('STAT_02',ADSTAT_L82.$logStr,''); e107::getLog()->add('STAT_02',ADSTAT_L82.$logStr,'');
} }
$ns->tablerender($caption, $mes->render() . $text); echo $mes->render() ;
function gen_select($prompt,$name,$value) function gen_select($prompt,$name,$value)
{ {
@@ -337,6 +339,7 @@ switch ($action)
</div> </div>
</form>"; </form>";
$ns->tablerender(ADSTAT_L16, $text); $ns->tablerender(ADSTAT_L16, $text);
break; // case config break; // case config