public function getInput() { global $mctrl; $mctrl =& MissionControl::getInstance(); if ($mctrl->_getCurrentAdminTemplate() == "rt_missioncontrol") { $this->checkForGantryUpdate(); $html = ''; $updates = RTMCUpdates::getInstance(); $currentVersion = $updates->getCurrentVersion(); $latest_version = $updates->getLatestVersion(); if (version_compare($latest_version, $currentVersion, '>')) { $klass = "updates-true"; $upd = JText::sprintf('MC_VERSION_UPDATE_OUTOFDATE', $latest_version, 'index.php?option=com_installer&view=update'); } else { $klass = "updates"; jimport('joomla.utilities.date'); $nextupdate = new JDate($updates->getLastUpdated() + 24 * 60 * 60); $upd = JText::sprintf('MC_VERSION_UPDATE_CURRENT', JHTML::_('date', $updates->getLastUpdated() + 24 * 60 * 60, JText::_('DATE_FORMAT_LC2'), true)); } $html .= "\n <div id='updater' class='" . $klass . " mc-update-check'>\n <div id='updater-bar' class='h2bar'>MissionControl <span>v" . $currentVersion . "</span></div>\n <div id='updater-desc'>" . $upd . "</div>\n </div>"; return $html; } else { $html = '<b>* ' . JTEXT::_('MC_ONLY_IN_MC') . '</b>'; } return $html; }
public static function getInstance() { if (!self::$instance) { self::$instance = new MissionControl(); } return self::$instance; }
function fetchElement($name, $value, &$node, $control_name) { global $mctrl; $mctrl = MissionControl::getInstance(); $output = ''; $doc =& JFactory::getDocument(); $transparent = 1; if ($node->attributes('transparent') == 'false') { $transparent = 0; } if (!defined('MC_MOORAINBOW')) { $doc->addStyleSheet($mctrl->templateUrl . '/elements/colorchooser/css/mooRainbow.css'); $doc->addScript($mctrl->templateUrl . '/elements/colorchooser/js/mooRainbow' . $this->getJSVersion() . '.js'); //$scriptconfig = $this->populateStyles($stylesList); $scriptconfig = $this->rainbowInit(); $doc->addScriptDeclaration($scriptconfig); define('MC_MOORAINBOW', 1); } $scriptconfig = $this->newRainbow($name, $transparent); $doc->addScriptDeclaration($scriptconfig); $output .= "<div class='wrapper'>"; $output .= "<input class=\"picker-input text-color\" id=\"" . $control_name . $name . "\" name=\"" . $control_name . "[" . $name . "]\" type=\"text\" size=\"7\" maxlength=\"11\" value=\"" . $value . "\" />"; $output .= "<div class=\"picker\" id=\"myRainbow_" . $name . "_input\"><div class=\"overlay" . ($value == 'transparent' ? ' overlay-transparent' : '') . "\"><div></div></div></div>\n"; $output .= "</div>"; //$output = false; return $output; }
public function getInput() { global $mctrl; $mctrl = MissionControl::getInstance(); $mctrl->document->addStylesheet('modules/mod_rokuserstats/tmpl/rokuserstatsadmin.css'); $mctrl->document->addScript('modules/mod_rokuserstats/tmpl/rokuserstatsadmin.js'); $clean_url = "?process=ajax&model=statscleaner&action="; $html = "\n <div id='cleanData'>\n <span class='mc-button'><span class=\"spinner\"></span><a href='" . $clean_url . "user' id='cleanUserDataBtn'>Clear UserStat Data</a></span>\n <span class='mc-button'><span class=\"spinner\"></span><a href='" . $clean_url . "admin' id='cleanAdminDataBtn'>Clear AdminAudit Data</a></span>\n </div>"; return $html; }
function fetchElement($name, $value, &$node, $control_name) { global $mctrl; $mctrl =& MissionControl::getInstance(); if ($mctrl->_getCurrentAdminTemplate() == "rt_missioncontrol_j15") { $upload_url = "?process=ajax&model=logoupload"; $html = '<iframe src="' . $upload_url . '" class="mc-logoupload"></iframe>'; } else { $html = '<b>* Feature only available within MissionControl</b>'; } return $html; }
public function getInput() { global $mctrl; $mctrl =& MissionControl::getInstance(); if ($mctrl->_getCurrentAdminTemplate() == "rt_missioncontrol") { $upload_url = "?process=ajax&model=logoupload"; $output = '<iframe src="' . $upload_url . '" class="mc-logoupload"></iframe>'; } else { $output = '<b>* ' . JTEXT::_('MC_ONLY_IN_MC') . '</b>'; } return $output; }
function display($update = false) { global $mctrl; // see if $mctrl has been initiated yet, if not do so if (!$mctrl) { require_once JPATH_ADMINISTRATOR . '/templates/rt_missioncontrol_j15/lib/missioncontrol.class.php'; $mctrl =& MissionControl::getInstance(); } $output = ''; $update_info = ''; require_once $mctrl->templatePath . '/lib/updater/rokupdater.class.php'; if (!$update) { $mctrl->addScript('MC.Updater.js'); } $params =& $mctrl->params; $updater = new RokUpdater(); $updater->init($mctrl->updateUrl, $mctrl->updateSlug, $params, $params->get('updater_dl_method'), $params->get('updater_extract_method')); // do update stuff ob_start(); if ($update) { if ($updater->installUpdate()) { $update_info = '<b>Success!</b> '; } else { $update_info = '<b class="mc-error">Update Failed. </b>'; } } //get status details $details = $updater->updateAvailable(); $errors = ob_get_clean(); if ($details === false || $errors) { $output .= '<div class="mc-update-check updates-true">'; $output .= '<b>There was an error processing your request:</b>'; $output .= $errors; $output .= '<p class="mc-update"><a href="#">Force Update</a> <span class="spinner"></span></p>'; $output .= '</div>'; } else { if ($details->updates) { $output .= '<div class="mc-update-check updates-true">'; $output .= $update_info . $details->name . ' <span class="mc-new-version">' . $details->version . '</span> is now available. '; $output .= 'You have version <span class="mc-old-version">' . $details->current_version . '</span>. '; $output .= '<p class="mc-update"><a href="#">1-Click Update</a> <span class="spinner"></span></p>'; $output .= '</div>'; } else { $output .= '<div class="mc-update-check updates-false">'; $output .= $update_info . $details->name . ' <span class="mc-old-version">' . $details->current_version . '</span> is the most current version available. '; $output .= '<p class="mc-update"><a href="#">Force Update</a> <span class="spinner"></span></p>'; $output .= '</div>'; } } return $output; }
public function testRun() { $mc = new MissionControl(); $file = fopen(dirname(__FILE__) . "/data/input", "r"); $mc->readInput($file); $this->assertSame(array("5 5", "1 1 N", "LLLLM", "2 2 S", "LLLM"), $mc->getInput()); $mc->createPlateau(); $this->assertSame(array("5", "5"), $mc->getPlateau()->getSize()); $rovers = $mc->createRovers()->getRovers(); $this->assertEquals(2, count($rovers)); $mc->run(); $this->assertEquals(array(1, 2, "N"), $rovers[0]->getPosition()); $this->assertEquals(array(1, 2, "W"), $rovers[1]->getPosition()); }
function fetchElement($name, $value, &$node, $control_name) { global $mctrl; $mctrl =& MissionControl::getInstance(); if ($mctrl->_getCurrentAdminTemplate() == "rt_missioncontrol_j15") { $ftp = JClientHelper::getCredentials('ftp'); if ($ftp['enabled']) { $html = '<div class="mc-update-check"><b>* FTP mode currently not supported in Auto-Update</b><br />Please check the MissionControl forum for information on the latest version.</div>'; } else { $html = MCUpdater::display(false); } } else { $html = '<b>* Feature only available within MissionControl</b>'; } return $html; }
public function getInput() { global $mctrl; $mctrl =& MissionControl::getInstance(); $doc =& JFactory::getDocument(); $output = ''; $transparent = 1; if ($this->element->attributes('transparent') == 'false') { $transparent = 0; } if (!defined('MC_MOORAINBOW')) { $doc->addStyleSheet($mctrl->templateUrl . '/fields/colorchooser/css/mooRainbow.css'); $doc->addScript($mctrl->templateUrl . '/fields/colorchooser/js/mooRainbow.js'); $doc->addScript($mctrl->templateUrl . '/fields/colorchooser/js/colorchooser.js'); $doc->addScriptDeclaration("var MCURL = '" . $mctrl->templateUrlAbsolute . "'"); define('MC_MOORAINBOW', 1); } $doc->addScriptDeclaration("MCColorChooser.add('" . $this->id . "', " . $transparent . ");"); $output .= "<div class='wrapper'>"; $output .= "<input class=\"picker-input text-color\" id=\"" . $this->id . "\" name=\"" . $this->name . "\" type=\"text\" size=\"7\" maxlength=\"11\" value=\"" . $this->value . "\" />"; $output .= "<div class=\"picker\" id=\"myRainbow_" . $this->id . "_input\"><div class=\"overlay" . ($this->value == 'transparent' ? ' overlay-transparent' : '') . "\" style=\"background-color: " . $this->value . "\"><div></div></div></div>\n"; $output .= "</div><div class=\"clr\"></div>"; return $output; }
<?php /** * @version � 1.5.2 June 9, 2011 * @author � �RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2011 RocketTheme, LLC * @license � http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ // no direct access defined('_JEXEC') or die('Restricted access'); // load and init the MissioControl Class require_once 'lib/missioncontrol.class.php'; $mctrl = MissionControl::getInstance(); $mctrl->initRenderer(); $mctrl->addStyle("core.css"); $mctrl->addStyle("menu.css"); $mctrl->addStyle("colors.css.php"); $mctrl->addStyle("http://fonts.googleapis.com/css?family=Josefin+Sans+Std+Light&subset=latin"); $mctrl->addOverrideStyles(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $mctrl->language; ?> " lang="<?php echo $mctrl->language; ?> " dir="<?php echo $mctrl->direction; ?> ">
public function onAfterInitialise() { $mainframe = JFactory::getApplication(); $option = JRequest::getString('option'); $extension = JRequest::getString('extension', null); if ($mainframe->isAdmin()) { $admin_style = null; $session_user_style = JFactory::getUser()->getParam('admin_style', null); $session_default_user_style = JFactory::getUser()->getParam('mc_default_style', null); $base_user_style = $this->getBaseUserInfo()->getParam('admin_style', null); $default_style = $this->getDefaultTemplate()->id; $mc_template = $this->getTemplateByName('rt_missioncontrol'); $mc_style = 0; if (!empty($mc_template)){ $mc_style = $mc_template->id; } if (null == $base_user_style && null != $session_user_style && $session_user_style != $session_default_user_style) { $admin_style = $session_default_user_style; } else if (null != $base_user_style && null != $session_user_style && $base_user_style != $session_user_style) { $admin_style = $base_user_style; } else if (null == $base_user_style && null == $session_user_style) { $admin_style = $default_style; } else if (null != $base_user_style && null == $session_user_style) { $admin_style = $base_user_style; } else if (null != $base_user_style && null != $session_user_style) { $admin_style = $session_user_style; } if (null != $session_default_user_style) { $admin_style = $session_default_user_style; } JFactory::getUser()->setParam('mc_default_style', null); //Only run of the current template is missioncontrol if ($default_style == $mc_style && ($admin_style == null || ($this->getTemplateById($admin_style) !== false && $admin_style == $mc_style))) { $blacklist = $mc_template->params->get('blacklist',null); $fallback_style = $mc_template->params->get('blackliststyle',$this->getTemplateByName('bluestork')->id); if (!empty($blacklist)) { if (in_array(strtolower($option), $blacklist) || in_array($extension, $blacklist)) { $admin_style = $fallback_style; JFactory::getUser()->setParam('mc_default_style', $default_style); } } } // set the admin style to the session user JFactory::getUser()->setParam('admin_style', $admin_style); // if the template is mission control set the toolbar to the missioncontrol one if ($mainframe->getTemplate() == "rt_missioncontrol" or $mainframe->getTemplate() == "rt_missioncontrol_j16") { JLoader::register('JButton', JPATH_ADMINISTRATOR.'/templates/rt_missioncontrol/lib/button.php'); JLoader::load('JButton'); JLoader::register('JToolBar', JPATH_ADMINISTRATOR . '/templates/rt_missioncontrol/lib/toolbar.php'); JLoader::load('JToolBar'); } // process Ajax if (JRequest::getString('process') == 'ajax' && JRequest::getString('model')) { global $mctrl; $mctrl = MissionControl::getInstance(); $mctrl->processAjax(); } } }