1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 20:21:51 +02:00

Fixes #764 - banners menu now functional

This commit is contained in:
Cameron 2015-01-29 14:09:47 -08:00
parent ff6d84e5e1
commit e279160039
2 changed files with 28 additions and 24 deletions

View File

@ -81,7 +81,9 @@ if (isset($_POST['update_menu']))
$menuPref->setPref($k, $v);
}
$menuPref->save(false, true, false);
e107::getMessage()->addSuccess(LAN_SAVED);
$menu_pref = e107::getConfig('menu')->getPref('');
//banners_adminlog('01', $menu_pref['banner_caption'].'[!br!]'.$menu_pref['banner_amount'].', '.$menu_pref['banner_rendertype'].'[!br!]'.$menu_pref['banner_campaign']);
}
}
@ -598,7 +600,7 @@ if ($action == "menu")
<tbody>
<tr>
<td>".BNRLAN_37."</td>
<td>".$frm->text('banner_caption', $menu_pref['banner_caption'])."</td>
<td>".$frm->text('banner_caption', $menu_pref['banner_caption'],255,'size=xxlarge')."</td>
</tr>
<tr>
<td>".BNRLAN_39."</td>
@ -607,19 +609,21 @@ if ($action == "menu")
if($all_catname)
{
foreach($all_catname as $name)
{
//$text .= "<option value='{$name}'>{$name}</option>";
$text .= "
<div class='field-spacer'>
".$frm->checkbox('multiaction_cat_active[]', $name, in_array($name, $in_catname)).$frm->label($name, 'multiaction_cat_active[]', $name)."
".$frm->checkbox('multiaction_cat_active[]', $name, in_array($name, $in_catname), $name)."
</div>
";
}
$text .= "
<div class='field-spacer'>
".$frm->admin_button('check_all', LAN_CHECKALL, 'other')."
".$frm->admin_button('uncheck_all', LAN_UNCHECKALL, 'other')."
<div class='field-spacer control-group form-group'>
".$frm->admin_button('check_all', 'jstarget:multiaction_cat_active', 'checkall', LAN_CHECKALL)."
".$frm->admin_button('uncheck_all','jstarget:multiaction_cat_active', 'checkall', LAN_UNCHECKALL)."
</div>
";
}
@ -627,6 +631,13 @@ if ($action == "menu")
{
$text .= BNRLAN_40;
}
$renderTypes = array(BNRLAN_44,'1 - '.BNRLAN_45,'2 - '.BNRLAN_46);
// $renderTypes[3] = "3 - ".BNRLAN_47; //TODO
$text .= "
</td>
@ -637,14 +648,7 @@ if ($action == "menu")
</tr>
<tr>
<td>".BNRLAN_43."</td>
<td>
<select class='tbox select' id='banner_rendertype' name='banner_rendertype'>
".$frm->option(BNRLAN_44, 0, (empty($menu_pref['banner_rendertype'])))."
".$frm->option("1 - ".BNRLAN_45, 1, ($menu_pref['banner_rendertype'] == "1"))."
".$frm->option("2 - ".BNRLAN_46, 2, ($menu_pref['banner_rendertype'] == "2"))."
".$frm->option("3 - ".BNRLAN_47, 3, ($menu_pref['banner_rendertype'] == "3"))."
</select>
</td>
<td>".$frm->select('banner_rendertype', $renderTypes, $menu_pref['banner_rendertype'],'size=xxlarge')."</td>
</tr>
</tbody>
</table>

View File

@ -30,9 +30,12 @@ To define your own banner to use here ...
3. Save file
*/
//inclXXXude_lan(e_PLUGIN.'banner/languages/'.e_LANGUAGE.'_menu_banner.php');
if(file_exists(THEME.'banner_template.php'))
if(file_exists(THEME.'templates/banner/banner_template.php')) // v2.x location.
{
require_once (THEME.'templates/banner/banner_template.php');
}
elseif(file_exists(THEME.'banner_template.php')) // v1.x location.
{
require_once (THEME.'banner_template.php');
}
@ -46,10 +49,8 @@ $menu_pref = e107::getConfig('menu')->getPref('');
if(isset($campaign))
{
$parm = $campaign;
$bannersccode = file_get_contents(e_CORE.'shortcodes/single/banner.sc'); // FIXME file not there?
$BANNER = eval($bannersccode);
$txt = $BANNER_MENU_START;
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
$txt .= e107::getParser()->parseTemplate("{BANNER=".$parm."}",true);
$txt .= $BANNER_MENU_END;
}
@ -79,13 +80,12 @@ else
}
$txt = $BANNER_MENU_START;
foreach ($parms as $parm)
{
$bannersccode = file_get_contents(e_CORE.'shortcodes/banner.sc');
$BANNER = eval($bannersccode);
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
$txt .= e107::getParser()->parseTemplate("{BANNER=".$parm."}",true);
}
$txt .= $BANNER_MENU_END;
}