Skip to content

Commit

Permalink
Remove bootstrap checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Demmer committed Jan 30, 2015
1 parent c3ce2d7 commit 09f503b
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 114 deletions.
74 changes: 36 additions & 38 deletions controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private function loadMenu() {
* and includes addition of the JDocument Object with required scripts and styles
* @return object
*/
public function getView($name = '', $type = '', $prefix = '', $config = array()) {
public function getView($name = '', $type = '', $prefix = '', $config = array()) {
$language = JFactory::getLanguage();
$language->load('com_jce', JPATH_ADMINISTRATOR);

Expand All @@ -76,26 +76,25 @@ public function getView($name = '', $type = '', $prefix = '', $config = array())
'base_path' => dirname(__FILE__)
);
}

$model = $this->getModel($name);

$view = parent::getView($name, $type, $prefix, $config);
$document = JFactory::getDocument();

// check for bootstrap
$bootstrap = is_file(JPATH_LIBRARIES . '/cms/html/bootstrap.php');

// not using JUI...
if (!$bootstrap) {
// set device-width meta
$document->setMetaData('meta', 'width=device-width, initial-scale=1.0');
// set device-width meta
$document->setMetaData('meta', 'width=device-width, initial-scale=1.0');

$version = new JVersion;

// JQuery UI
if ($version->isCompatible('3.0')) {
// Include jQuery
JHtml::_('jquery.framework');
} else {
// JQuery
$view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/jquery/js/jquery.min.js');
// jQuery noConflict
$view->addScriptDeclaration('jQuery.noConflict();');
} else {
JHtml::_('bootstrap.framework');
}

// JQuery UI
Expand All @@ -105,11 +104,11 @@ public function getView($name = '', $type = '', $prefix = '', $config = array())

switch ($name) {
case 'help':
$view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/help.js');
$view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/help.js');
break;
default:
$view->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/global.css');

// load Joomla! core javascript
if (method_exists('JHtml', 'core')) {
JHtml::core();
Expand All @@ -121,7 +120,7 @@ public function getView($name = '', $type = '', $prefix = '', $config = array())

$params = WFParameterHelper::getComponentParams();
$theme = $params->get('preferences.theme', 'jce');

$view->addScript(JURI::root(true) . '/administrator/components/com_jce/media/js/core.js');

$options = array(
Expand All @@ -133,8 +132,7 @@ public function getView($name = '', $type = '', $prefix = '', $config = array())
'saveclose' => WFText::_('WF_LABEL_SAVECLOSE'),
'alert' => WFText::_('WF_LABEL_ALERT'),
'required' => WFText::_('WF_MESSAGE_REQUIRED')
),
'bootstrap' => $bootstrap
)
);

$view->addScriptDeclaration('jQuery.jce.options = ' . json_encode($options) . ';');
Expand All @@ -159,35 +157,34 @@ public function getView($name = '', $type = '', $prefix = '', $config = array())

return $view;
}

protected function getStyles()
{

protected function getStyles() {
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');

wfimport('admin.helpers.extension');

$view = JRequest::getCmd('view', 'cpanel');

$component = WFExtensionHelper::getComponent();
$params = new WFParameter($component->params);
$theme = $params->get('preferences.theme', 'jce');
$site_path = JPATH_COMPONENT_SITE . '/editor/libraries/css';
$admin_path = JPATH_COMPONENT_ADMINISTRATOR . '/media/css';
$component = WFExtensionHelper::getComponent();
$params = new WFParameter($component->params);

$theme = $params->get('preferences.theme', 'jce');
$site_path = JPATH_COMPONENT_SITE . '/editor/libraries/css';
$admin_path = JPATH_COMPONENT_ADMINISTRATOR . '/media/css';

// Load styles
$styles = array();
if (!JFolder::exists($site_path . '/jquery/' . $theme)) {

if (!JFolder::exists($site_path . '/jquery/' . $theme)) {
$theme = 'jce';
}

// admin global css
$styles = array_merge($styles, array(
'administrator/components/com_jce/media/css/global.css'
));

return $styles;
}

Expand Down Expand Up @@ -252,7 +249,7 @@ public function repair() {
$type = JRequest::getWord('type', 'tables');

switch ($type) {
case 'tables' :
case 'tables' :
wfimport('admin.models.profiles');
$profiles = new WFModelProfiles();

Expand Down Expand Up @@ -283,7 +280,7 @@ public function repair() {

public function authorize($task) {
wfimport('admin.models.model');

// map updates/blank/cpanel task to manage
if (empty($task) || $task == 'cpanel' || $task == 'updates') {
$task = 'manage';
Expand All @@ -308,21 +305,22 @@ private static function _redirect($msg = '', $state = '') {

return false;
}

public function cleanInput($input, $method = 'string') {
$filter = JFilterInput::getInstance();
$input = (array) $input;
$input = (array) $input;

foreach($input as $k => $v) {
foreach ($input as $k => $v) {
if (is_array($v)) {
$input[$k] = $this->cleanInput($v, $method);
} else {
$input[$k] = $filter->clean($v, $method);
}
}

return $input;
}

}

?>
4 changes: 2 additions & 2 deletions media/css/profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ html[dir="rtl"] .ui-jce .ui-tabs-vertical .ui-tabs-panel {
margin : 0 10px;
}

.ui-bootstrap #jce div.tab-pane.tabbable.tabs-left ul li > a:first-child {
#jce div.tab-pane.tabbable.tabs-left ul li > a:first-child {
max-width: 100px;
padding-bottom: 20px;
padding-top: 20px;
Expand All @@ -285,7 +285,7 @@ html[dir="rtl"] .ui-jce .ui-tabs-vertical .ui-tabs-panel {
box-shadow: inset -1px 0px 1px px rgba(0, 0, 0, 0.05);
}

.ui-bootstrap #jce div.tab-pane.tabbable.tabs-left ul li.active > a {
#jce div.tab-pane.tabbable.tabs-left ul li.active > a {
background-color : #fff;
border-color : #eee #fff #eee #eee;

Expand Down
Loading

0 comments on commit 09f503b

Please sign in to comment.