1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 17:01:43 +02:00

Bootstrap3 styling fixes and some removal of deprecated save_prefs() usage.

This commit is contained in:
Cameron
2014-01-15 02:56:39 -08:00
parent 712379f52e
commit c567fd265b
10 changed files with 30 additions and 26 deletions

View File

@@ -24,7 +24,7 @@ define('e_CAPTCHA_FONTCOLOR','#F9A533');
// Required for a clean v1.x -> v2 upgrade.
$core = e107::getConfig('core');
if($core->get('admintheme') != 'bootstrap')
if($core->get('admintheme') != 'bootstrap' && $core->get('admintheme') != 'bootstrap3')
{
$core->update('admintheme','bootstrap');
$core->update('adminstyle','infopanel');

View File

@@ -135,7 +135,7 @@ class page_chapters_ui extends e_admin_ui
'chapter_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'readonly'=>FALSE),
'chapter_meta_keywords' => array('title'=> "Meta Keywords", 'type' => 'tags', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
'chapter_sef' => array('title'=> "SEF Url String", 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'inline'=>true, 'writeParms'=>'size=xxlarge'), // Display name
'chapter_sef' => array('title'=> "SEF Url String", 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'inline'=>true, 'writeParms'=>'size=xxlarge&inline-empty=1'), // Display name
'chapter_manager' => array('title'=> "Can be edited by", 'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE),
'chapter_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ),

View File

@@ -194,7 +194,7 @@ class cpage_shortcodes extends e_shortcode
$size = vartrue($options['size'], "");
$inc = ($size) ? " btn-".$size : "";
return '<a class="cpage btn btn-primary'.$inc.'" href="'.$url.'">'.$text.'</a>';
return '<a class="cpage btn btn-primary btn-cpage'.$inc.'" href="'.$url.'">'.$text.'</a>';
}

View File

@@ -418,7 +418,7 @@ class e_form
{
$text = "<input class='tbox' style='width:80%' id='{$idinput}' type='text' name='image' size='40' value='$curVal' maxlength='100' title=\"".LAN_SIGNUP_111."\" />";
$text .= "<img src='".$img."' id='{$previnput}' style='display:none' />";
$text .= "<input class='img-rounded btn button e-expandit' type ='button' style='cursor:pointer' size='30' value=\"Choose Avatar\" />"; //TODO Common LAN.
$text .= "<input class='img-rounded btn btn-default button e-expandit' type ='button' style='cursor:pointer' size='30' value=\"Choose Avatar\" />"; //TODO Common LAN.
}
$avFiles = e107::getFile()->get_files(e_AVATAR_DEFAULT,".jpg|.png|.gif|.jpeg|.JPG|.GIF|.PNG");
@@ -605,7 +605,7 @@ class e_form
$cat = vartrue($sc_parameters['media']) ? $tp->toDB($sc_parameters['media']) : "_common_file";
$default_label = ($default) ? $default : "Choose a file";
$label = "<span id='{$name_id}_prev' class='btn btn-small'>".basename($default_label)."</span>";
$label = "<span id='{$name_id}_prev' class='btn btn-default btn-small'>".basename($default_label)."</span>";
$sc_parameters['mode'] = 'main';
$sc_parameters['action'] = 'dialog';
@@ -831,7 +831,7 @@ class e_form
if(vartrue($options['generate']))
{
$gen = '&nbsp;<a href="#" class="btn btn-small e-tip" id="Spn_PasswordGenerator" title="Generate a password">Generate</a> <a class="btn btn-small e-tip" href="#" id="showPwd" title="Display the password">Show</a><br />';
$gen = '&nbsp;<a href="#" class="btn btn-default btn-small e-tip" id="Spn_PasswordGenerator" title="Generate a password">Generate</a> <a class="btn btn-default btn-small e-tip" href="#" id="showPwd" title="Display the password">Show</a><br />';
}
if(vartrue($options['strength']))
@@ -1544,26 +1544,26 @@ class e_form
case 'edit':
$image = ADMIN_EDIT_ICON_PATH;
$icon = "e-edit-32";
$options['class'] = $options['class'] == 'action' ? 'btn action edit' : $options['class'];
$options['class'] = $options['class'] == 'action' ? 'btn btn-default action edit' : $options['class'];
break;
case 'delete':
$image = ADMIN_DELETE_ICON_PATH;
$icon = "e-delete-32";
$options['class'] = $options['class'] == 'action' ? 'btn action delete' : $options['class'];
$options['class'] = $options['class'] == 'action' ? 'btn btn-default action delete' : $options['class'];
$options['other'] = 'data-confirm="'.LAN_JSCONFIRM.'"';
break;
case 'execute':
$image = ADMIN_EXECUTE_ICON_PATH;
$icon = "e-execute-32";
$options['class'] = $options['class'] == 'action' ? 'btn action execute' : $options['class'];
$options['class'] = $options['class'] == 'action' ? 'btn btn-default action execute' : $options['class'];
break;
case 'view':
$image = ADMIN_VIEW_ICON_PATH;
$icon = "e-view-32";
$options['class'] = $options['class'] == 'action' ? 'btn action view' : $options['class'];
$options['class'] = $options['class'] == 'action' ? 'btn btn-default action view' : $options['class'];
break;
}
$options['title'] = $title;//shorthand
@@ -2414,7 +2414,7 @@ class e_form
{
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
$from = intval(vartrue($_GET['from'],0));
$value .= "<a class='e-sort sort-trigger btn ' style='cursor:move' data-target='".e_SELF."?mode={$mode}&action=sort&ajax_used=1&from={$from}' title='Re-order'>".ADMIN_SORT_ICON."</a> ";
$value .= "<a class='e-sort sort-trigger btn btn-default' style='cursor:move' data-target='".e_SELF."?mode={$mode}&action=sort&ajax_used=1&from={$from}' title='Re-order'>".ADMIN_SORT_ICON."</a> ";
}
$cls = false;
@@ -2430,7 +2430,7 @@ class e_form
<img class='icon action edit list' src='".ADMIN_EDIT_ICON_PATH."' alt='".LAN_EDIT."' /></a>";
*/
$value .= "<a href='".e_SELF."?{$query}' class='btn' title='".LAN_EDIT."' data-toggle='tooltip' data-placement='left'>
$value .= "<a href='".e_SELF."?{$query}' class='btn btn-default' title='".LAN_EDIT."' data-toggle='tooltip' data-placement='left'>
".ADMIN_EDIT_ICON."</a>";
}
@@ -2440,12 +2440,12 @@ class e_form
$cls = (deftrue($parms['deleteClass'])) ? constant($parms['deleteClass']) : $parms['deleteClass'];
if(check_class($cls))
{
$value .= $this->submit_image('etrigger_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn'.$delcls));
$value .= $this->submit_image('etrigger_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn btn-default'.$delcls));
}
}
else
{
$value .= $this->submit_image('etrigger_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn'.$delcls));
$value .= $this->submit_image('etrigger_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn btn-default'.$delcls));
}
}
//$attributes['type'] = 'text';
@@ -2646,8 +2646,8 @@ class e_form
$ttl = vartrue($parms['expand']);
if($ttl == 1)
{
$ttl = $expand."<button class='btn btn-mini pull-right'>More..</button>";
$ttl1 = "<button class='btn btn-mini pull-right'>..Less</button>";
$ttl = $expand."<button class='btn btn-default btn-mini pull-right'>More..</button>";
$ttl1 = "<button class='btn btn-default btn-mini pull-right'>..Less</button>";
}
$expands = '<a href="#'.$elid.'-expand" class="e-show-if-js e-expandit">'.defset($ttl, $ttl)."</a>";
@@ -4160,7 +4160,7 @@ class form
$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
$image = ($form_image ? " src='".$form_image."' " : "");
$tooltip = ($form_tooltip ? " title='".$form_tooltip."' " : "");
return "\n<input class='btn button' type='".$form_type."' ".$form_js." value='".$form_value."'".$name.$image.$tooltip." />";
return "\n<input class='btn btn-default button' type='".$form_type."' ".$form_js." value='".$form_value."'".$name.$image.$tooltip." />";
}
function form_textarea($form_name, $form_columns, $form_rows, $form_value, $form_js = "", $form_style = "", $form_wrap = "", $form_readonly = "", $form_tooltip = "") {

View File

@@ -1626,6 +1626,8 @@ class e_menuManager {
}
$pref['menuconfig_list'] = vartrue($tmp);
save_prefs();
e107::getConfig()->setPref($pref)->save(false,true,false);
// save_prefs();
}
} // end of Class.

View File

@@ -27,7 +27,7 @@ class themeHandler
var $themeConfigObj = null;
var $noLog = FALSE;
private $approvedAdminThemes = array('bootstrap');
private $approvedAdminThemes = array('bootstrap','bootstrap3');
public $allowedCategories = array('generic',
'adult',
@@ -1686,6 +1686,7 @@ class themeHandler
$pref['admintheme'] = $themeArray[$this->id];
$pref['admincss'] = file_exists(e_THEME.$pref['admintheme'].'/admin_dark.css') ? 'admin_dark.css' : 'admin_light.css';
$e107cache->clear_sys();
if(save_prefs())
{
// Default Message

View File

@@ -90,7 +90,7 @@ class plugin_featurebox_item extends e_model
$title = vartrue($parm['text']) ? defset($parm['text']) : LAN_MORE;
$alt = $tp->toAttribute($this->get('fb_title'), false, 'TITLE');
$buttonCls = vartrue($parm['button']) ? 'class="btn btn-primary" ' : "";
$buttonCls = vartrue($parm['button']) ? 'class="btn btn-primary btn-featurebox" ' : "";

View File

@@ -64,7 +64,7 @@ $NEWS_MENU_TEMPLATE['other']['item'] = '<div class="item {ACTIVE}">
{NEWSIMAGE=placeholder}
<h3>{NEWSTITLE}</h3>
<p>{NEWSSUMMARY}</p>
<p class="text-right"><a class="btn btn-primary" href="{NEWSURL}">'.LAN_READ_MORE.' &raquo;</a></p>
<p class="text-right"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">'.LAN_READ_MORE.' &raquo;</a></p>
</div>';
$NEWS_MENU_TEMPLATE['other']['end'] = "</div></div>";
@@ -82,7 +82,7 @@ $NEWS_MENU_TEMPLATE['other2']['start'] = "<ul class='media-list unstyled othern
$NEWS_MENU_TEMPLATE['other2']['item'] = "<li class='media'>
<span class='media-object pull-left'>{NEWSIMAGE=placeholder}</span>
<div class='media-body'><h4>{NEWSTITLELINK}</h4>
<p class='text-right'><a class='btn btn-primary' href='{NEWSURL}'>".LAN_READ_MORE." &raquo;</a></p>
<p class='text-right'><a class='btn btn-primary btn-othernews2' href='{NEWSURL}'>".LAN_READ_MORE." &raquo;</a></p>
</div>
</li>\n";

View File

@@ -110,4 +110,4 @@ body {
opacity: 1;
}
.btn { margin-top:10px }
.btn-featurebox, .btn-cpage { margin-top:10px }

View File

@@ -274,16 +274,17 @@ class pageClass
while($row = $sql->fetch())
{
$tmp = $this->listPages(intval($row['chapter_id']),$book_sef, $row['chapter_sef']);
$tmp = $this->listPages(intval($row['chapter_id']));
$row['book_sef'] = $this->getSef($row['chapter_parent']);
$pages = ($tmp['text']);
$var = array(
'CHAPTER_NAME' => $tp->toHtml($row['chapter_name']),
'CHAPTER_ANCHOR' => $frm->name2id($row['chapter_name']),
'CHAPTER_ICON' => $this->chapterIcon($row['chapter_icon']),
'CHAPTER_DESCRIPTION' => $tp->toHtml($row['chapter_meta_description'],true,'BODY'),
'PAGES' => $tmp['text'],
'PAGES' => $pages,
'CHAPTER_URL' => e107::getUrl()->create('page/chapter/index', $row,'allow=chapter_id,chapter_sef,book_sef') // e_BASE."page.php?ch=".intval($row['chapter_id']) // FIXME SEF-URL
);
@@ -356,7 +357,7 @@ class pageClass
if(!$count = $sql->select("page", "*", "page_title !='' AND page_chapter=".intval($chapt)." AND page_class IN (".USERCLASS_LIST.") ORDER BY page_order ASC "))
{
return e107::getMessage()->addInfo(LAN_PAGE_2)->render();
return array('text' => "<em>".(LAN_PAGE_2)."</em>");
// $text = "<ul class='page-pages-list page-pages-none'><li>".LAN_PAGE_2."</li></ul>";
}
else