public function theme_setup_wizard_content($content)
 {
     if ($this->is_possible_upgrade()) {
         array_unshift_assoc($content, 'upgrade', array('title' => __('Upgrade', 'envato_setup'), 'description' => __('Upgrade Content and Settings', 'envato_setup'), 'pending' => __('Pending.', 'envato_setup'), 'installing' => __('Installing Updates.', 'envato_setup'), 'success' => __('Success.', 'envato_setup'), 'install_callback' => array($this, '_content_install_updates'), 'checked' => 1));
     }
     return $content;
 }
Ejemplo n.º 2
0
function get_dropdown($p_control_array, $p_control_name, $p_match = '', $p_add_any = false, $p_multiple = false)
{
    $t_control_array = $p_control_array;
    if ($p_multiple) {
        $t_size = ' size="5"';
        $t_multiple = ' multiple="multiple"';
    } else {
        $t_size = '';
        $t_multiple = '';
    }
    $t_info = sprintf("<select %s name=\"%s\" id=\"%s\"%s>", $t_multiple, $p_control_name, $p_control_name, $t_size);
    if ($p_add_any) {
        array_unshift_assoc($t_control_array, META_FILTER_ANY, lang_trans('[any]'));
    }
    while (list($t_name, $t_desc) = each($t_control_array)) {
        $t_sel = '';
        if (is_array($p_match)) {
            if (in_array($t_name, array_values($p_match)) || in_array($t_desc, array_values($p_match))) {
                $t_sel = ' selected="selected"';
            }
        } else {
            if ($t_name === $p_match || $t_desc === $p_match) {
                $t_sel = ' selected="selected"';
            }
        }
        $t_info .= sprintf("<option%s value=\"%s\">%s</option>", $t_sel, $t_name, $t_desc);
    }
    $t_info .= "</select>\n";
    return $t_info;
}
Ejemplo n.º 3
0
//End Prevent Magic Quotes problem
jimport('joomla.application.component.controller');
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$version = new JVersion();
if ($app->input->get('format') != 'json') {
    //Ensure the Mootools fix for Ember is put on top of the scripts
    $headerdata = $document->getHeadData();
    $scripts = $headerdata['scripts'];
    function array_unshift_assoc($arr, $key, $val)
    {
        $arr = array_reverse($arr, true);
        $arr[$key] = $val;
        return array_reverse($arr, true);
    }
    $scripts = array_unshift_assoc($scripts, JURI::root() . 'media/com_jsonexport/js/lib/mootools-fix.js', array('mime' => 'text/javascript', 'defer' => false, 'async' => false));
    $headerdata['scripts'] = $scripts;
    $document->setHeadData($headerdata);
}
$document->addScriptDeclaration("var jqext = jQuery.prototype.extend;\n  delete jQuery.prototype.extend;\n  Function.prototype.extend = ext;\n  delete jQuery.prototype.extend;\n  jQuery.prototype.extend = jqext;\n");
if ($version->isCompatible('3.0')) {
    JHtml::_('jquery.framework');
} else {
    $document->addScript(JURI::root() . 'media/com_jsonexport/jui/js/jquery.min.js');
    $document->addScript(JURI::root() . 'media/com_jsonexport/jui/js/jquery-noconflict.js');
    $document->addScript(JURI::root() . 'media/com_jsonexport/jui/js/bootstrap.js');
    $document->addStyleSheet(JURI::root() . 'media/com_jsonexport/jui/css/bootstrap.css');
}
$app->JComponentTitle = '';
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    $document->addScript(JURI::root() . 'media/com_jsonexport/js/lib/handlebars.runtime-1.3.0.js');
Ejemplo n.º 4
0
 public function getOauthHostSelectOptions()
 {
     $hosts = array();
     foreach (WorkbenchConfig::get()->value('oauthConfigs') as $host => $hostInfo) {
         if (empty($hostInfo["label"]) || empty($hostInfo["key"]) || empty($hostInfo["secret"])) {
             continue;
         }
         $hosts[$host] = $hostInfo["label"];
     }
     if (array_key_exists("login.salesforce.com", $hosts)) {
         $loginHost = $hosts["login.salesforce.com"];
         unset($hosts["login.salesforce.com"]);
         $hosts = array_unshift_assoc($hosts, "login.salesforce.com", $loginHost);
     }
     return $hosts;
 }
Ejemplo n.º 5
0
	public function build($query, $assoc = false, $update_field = false) {
		if (!is_array($assoc)) {
			return false;
		}
		
		$fields = $values = array();
		
		switch ($query) {
			case 'INSERT':
				$column_name = '';
				if ($update_field !== false) {
					$first_assoc = array_shiftname($assoc);

					if (strpos($first_assoc, '_id') !== false) {
						$column_name = $first_assoc;
						$assoc[$first_assoc] = strtoupper($update_field . '_' . $first_assoc . '_seq') . '.nextval';
					} elseif (strpos($first_assoc, '_') !== false) {
						$first_part = explode('_', $first_assoc);
						$column_name = $first_part[0] . '_id';
						$sequence = strtoupper($update_field . '_' . $column_name . '_seq');

						array_unshift_assoc($assoc, $column_name, $sequence . '.nextval');

						/*
						Get primary key name and add before $assoc first field
						*/
						/*$u_update_field = strtoupper($update_field);

						$sql = 'SELECT cols.column_name
							FROM all_constraints cons, all_cons_columns cols
							WHERE cols.table_name = ?
								AND cons.constraint_type = ?
								AND cons.constraint_name = cols.constraint_name
								AND cons.owner = cols.owner
							ORDER BY cols.table_name, cols.position';
						$column_name = strtolower(sql_field(sql_filter($sql, $u_update_field, 'P'), 'column_name', ''));

						$sql = 'SELECT sequence_name
							FROM USER_SEQUENCES
							WHERE SEQUENCE_NAME LIKE ?';
						$sequence = sql_field(sql_filter($sql, '%' . $u_update_field . '%'), 'sequence_name', '');

						array_unshift_assoc($assoc, $column_name, $sequence . '.nextval');*/
					}
				}
				
				foreach ($assoc as $key => $var) {
					$fields[] = $key;
					
					if (is_null($var)) {
						$values[] = 'NULL';
					} elseif ($key == $column_name) {
						$values[] = $this->escape($var);
					} elseif (is_string($var)) {
						$values[] = "'" . $this->escape($var) . "'";
					} else {
						$values[] = (is_bool($var)) ? intval($var) : $var;
					}
				}

				$query = '';
				if ($update_field !== false) {
					$query .= 'INSERT INTO ' . $update_field;
				}
				
				$query .= ' /***/ (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
				break;
			case 'UPDATE':
			case 'SELECT':
				$values = array();
				
				foreach ($assoc as $key => $var) {
					if (is_null($var)) {
						$values[] = "$key = NULL";
					} elseif (is_string($var)) {
						if ($update_field && strpos($var, $key) !== false) {
							$values[] = $key . ' = ' . $this->escape($var);
						} else {
							$values[] = "$key = '" . $this->escape($var) . "'";
						}
					} else {
						$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
					}
				}
				$query = '/***/' . implode(($query == 'UPDATE') ? ', ' : ' AND ', $values);
				break;
		}
		
		return $query;
	}
 static function showconfig(&$lists, $MobileJoomla_Settings)
 {
     JHtml::_('behavior.tooltip');
     JHtml::_('behavior.switcher');
     JHtml::_('behavior.modal', 'a.modal');
     JToolBarHelper::title(JText::_('COM_MJ__MOBILE_JOOMLA_SETTINGS'), 'config.php');
     JToolBarHelper::apply();
     JToolBarHelper::cancel('cancel');
     $version = substr(JVERSION, 0, 3);
     $user = JFactory::getUser();
     if ($version != '1.5' && $user->authorise('core.admin', 'com_mobilejoomla')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_mobilejoomla');
     }
     HTML_mobilejoomla::showNotification();
     $document = JFactory::getDocument();
     $document->addScript(JUri::base(true) . '/components/com_mobilejoomla/js/mj_ui.js');
     $document->addStyleSheet(JUri::base(true) . '/components/com_mobilejoomla/css/mjsettings.css');
     self::$selftest_blob = array();
     self::checkGD2();
     self::checkRemoteConnection();
     self::checkAliasDuplicates();
     self::checkTemplateAssignments();
     self::checkForcedMarkup();
     self::checkDesktopURL($MobileJoomla_Settings);
     $config_blobs = array('COM_MJ__GENERAL_SETTINGS' => array(array('COM_MJ__MOBILE_SITE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__MOBILE_SITENAME', 'COM_MJ__MOBILE_SITENAME_DESC', 'mobile_sitename'), 'input_blob' => JHtml::_('mjconfig.textinput', 'mobile_sitename', $MobileJoomla_Settings['mobile_sitename'], 30))), 'COM_MJ__IMAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__IMAGE_QUALITY', 'COM_MJ__IMAGE_QUALITY_DESC', 'jpegquality'), 'input_blob' => '<span id="mjconfig_jpegquality_slider" class="mjconfig_slider"><span id="mjconfig_jpegquality_knob" class="mjconfig_knob"></span></span>' . JHtml::_('mjconfig.textinput', 'jpegquality', $MobileJoomla_Settings['jpegquality'], 2, array('style' => 'text-align:right')) . '%'), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__IMAGE_ADAPTATION_METHOD', 'COM_MJ__IMAGE_ADAPTATION_METHOD_DESC'), 'input_blob' => $lists['global.img'])), 'COM_MJ__HOMEPAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__FORCED_HOMEPAGE', 'COM_MJ__FORCED_HOMEPAGE_DESC', 'global.homepage'), 'input_blob' => JHtml::_('mjconfig.textinput', 'global.homepage', $MobileJoomla_Settings['global.homepage'])), array('input_blob' => JHtml::_('mjconfig.menulist', $lists['menuoptions'], 'global.homepage', $MobileJoomla_Settings['global.homepage'])), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__COMPONENT_ON_HOMEPAGE', 'COM_MJ__COMPONENT_ON_HOMEPAGE_DESC'), 'input_blob' => $lists['global.componenthome']))), array('COM_MJ__INFORMATION' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__CURRENT_VERSION'), 'input_blob' => '<p>' . self::getMJVersion() . '</p>'), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__LATEST_VERSION'), 'input_blob' => '<p id="mjconfig_latestver"><span id="mjlatestver"></span> <a class="fltrt modal" id="mjlatestverurl" href="index.php?tmpl=component&option=com_mobilejoomla&task=update" rel="{handler: \'iframe\', size: {x: 480, y: 320}}">' . JText::_('COM_MJ__UPDATE') . '</a></p>')), 'COM_MJ__SUPPORT' => array(array('label_blob' => '<p><a target="_blank" href="http://www.mobilejoomla.com/documentation.html?ref=info">' . JText::_('COM_MJ__DOCUMENTATION') . '</a></p>'), array('label_blob' => '<p><a target="_blank" href="http://www.mobilejoomla.com/forums.html?ref=info">' . JText::_('COM_MJ__FORUMS') . '</a></p>'), array('label_blob' => '<p><a target="_blank" href="http://www.mobilejoomla.com/blog.html?ref=info">' . JText::_('COM_MJ__LATEST_NEWS') . '</a></p>')))), 'COM_MJ__XHTMLMP_SETTINGS' => array(array('COM_MJ__SETTINGS' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__TEMPLATE_NAME', 'COM_MJ__TEMPLATE_NAME_XHTMLMP_DESC'), 'input_blob' => $lists['xhtml.template'])), 'COM_MJ__HOMEPAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__FORCED_HOMEPAGE', 'COM_MJ__FORCED_HOMEPAGE_DESC', 'xhtml.homepage'), 'input_blob' => JHtml::_('mjconfig.textinput', 'xhtml.homepage', $MobileJoomla_Settings['xhtml.homepage'])), array('input_blob' => JHtml::_('mjconfig.menulist', $lists['menuoptions'], 'xhtml.homepage', $MobileJoomla_Settings['xhtml.homepage'])), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__COMPONENT_ON_HOMEPAGE', 'COM_MJ__COMPONENT_ON_HOMEPAGE_DESC'), 'input_blob' => $lists['xhtml.componenthome'])), 'COM_MJ__IMAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__IMAGE_ADAPTATION_METHOD', 'COM_MJ__IMAGE_ADAPTATION_METHOD_DESC'), 'input_blob' => $lists['xhtml.img']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__DECREASE_IMAGE_WIDTH', 'COM_MJ__DECREASE_IMAGE_WIDTH_DESC', 'xhtml.buffer_width'), 'input_blob' => JHtml::_('mjconfig.textinput', 'xhtml.buffer_width', $MobileJoomla_Settings['xhtml.buffer_width'], 5, array('style' => 'text-align:right'))), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__STYLE_IMAGE_SIZE', 'COM_MJ__STYLE_IMAGE_SIZE_DESC'), 'input_blob' => $lists['xhtml.img_addstyles'])), 'COM_MJ__ADVANCED' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__GZIP_COMPRESSION'), 'input_blob' => $lists['xhtml.gzip']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__REMOVE_UNSUPPORTED_TAGS', 'COM_MJ__REMOVE_UNSUPPORTED_TAGS_XHTMLMP_DESC'), 'input_blob' => $lists['xhtml.removetags']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__REMOVE_SCRIPT_TAGS'), 'input_blob' => $lists['xhtml.removescripts']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__CONVERT_HTMLENTITIES', 'COM_MJ__CONVERT_HTMLENTITIES_DESC'), 'input_blob' => $lists['xhtml.entitydecode']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__CONTENT_TYPE', 'COM_MJ__CONTENT_TYPE_DESC'), 'input_blob' => $lists['xhtml.contenttype']))), array('COM_MJ__TEMPLATE_MODULES' => array(), 'COM_MJ__TEMPLATE_OPTIONS' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__USE_HEAD', 'COM_MJ__USE_HEAD_DESC'), 'input_blob' => $lists['xhtml.simplehead']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__EXTENDED_EDITORS', 'COM_MJ__EXTENDED_EDITORS_DESC'), 'input_blob' => $lists['xhtml.allowextedit']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__EMBED_CSS', 'COM_MJ__EMBED_CSS_DESC'), 'input_blob' => $lists['xhtml.embedcss']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__USE_XMLHEAD', 'COM_MJ__USE_XMLHEAD_DESC'), 'input_blob' => $lists['xhtml.xmlhead']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__DOCTYPE_HEAD'), 'input_blob' => $lists['xhtml.doctype']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__XMLNS_IN_HEAD', 'COM_MJ__XMLNS_IN_HEAD_DESC'), 'input_blob' => $lists['xhtml.xmlns'])))), 'COM_MJ__IPHONE_SETTINGS' => array(array('COM_MJ__SETTINGS' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__TEMPLATE_NAME', 'COM_MJ__TEMPLATE_NAME_IPHONE_DESC'), 'input_blob' => $lists['iphone.template'])), 'COM_MJ__HOMEPAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__FORCED_HOMEPAGE', 'COM_MJ__FORCED_HOMEPAGE_DESC', 'iphone.homepage'), 'input_blob' => JHtml::_('mjconfig.textinput', 'iphone.homepage', $MobileJoomla_Settings['iphone.homepage'])), array('input_blob' => JHtml::_('mjconfig.menulist', $lists['menuoptions'], 'iphone.homepage', $MobileJoomla_Settings['iphone.homepage'])), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__COMPONENT_ON_HOMEPAGE', 'COM_MJ__COMPONENT_ON_HOMEPAGE_DESC'), 'input_blob' => $lists['iphone.componenthome'])), 'COM_MJ__IMAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__IMAGE_ADAPTATION_METHOD', 'COM_MJ__IMAGE_ADAPTATION_METHOD_DESC'), 'input_blob' => $lists['iphone.img']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__DECREASE_IMAGE_WIDTH', 'COM_MJ__DECREASE_IMAGE_WIDTH_DESC', 'iphone.buffer_width'), 'input_blob' => JHtml::_('mjconfig.textinput', 'iphone.buffer_width', $MobileJoomla_Settings['iphone.buffer_width'], 5, array('style' => 'text-align:right'))), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__STYLE_IMAGE_SIZE', 'COM_MJ__STYLE_IMAGE_SIZE_DESC'), 'input_blob' => $lists['iphone.img_addstyles'])), 'COM_MJ__ADVANCED' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__GZIP_COMPRESSION'), 'input_blob' => $lists['iphone.gzip']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__REMOVE_UNSUPPORTED_TAGS'), 'input_blob' => $lists['iphone.removetags']))), array('COM_MJ__TEMPLATE_MODULES' => array())), 'COM_MJ__WML_SETTINGS' => array(array('COM_MJ__SETTINGS' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__TEMPLATE_NAME', 'COM_MJ__TEMPLATE_NAME_WML_DESC'), 'input_blob' => $lists['wml.template'])), 'COM_MJ__HOMEPAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__FORCED_HOMEPAGE', 'COM_MJ__FORCED_HOMEPAGE_DESC', 'wml.homepage'), 'input_blob' => JHtml::_('mjconfig.textinput', 'wml.homepage', $MobileJoomla_Settings['wml.homepage'])), array('input_blob' => JHtml::_('mjconfig.menulist', $lists['menuoptions'], 'wml.homepage', $MobileJoomla_Settings['wml.homepage'])), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__COMPONENT_ON_HOMEPAGE', 'COM_MJ__COMPONENT_ON_HOMEPAGE_DESC'), 'input_blob' => $lists['wml.componenthome'])), 'COM_MJ__IMAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__IMAGE_ADAPTATION_METHOD', 'COM_MJ__IMAGE_ADAPTATION_METHOD_DESC'), 'input_blob' => $lists['wml.img']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__DECREASE_IMAGE_WIDTH', 'COM_MJ__DECREASE_IMAGE_WIDTH_DESC', 'wml.buffer_width'), 'input_blob' => JHtml::_('mjconfig.textinput', 'wml.buffer_width', $MobileJoomla_Settings['wml.buffer_width'], 5, array('style' => 'text-align:right')))), 'COM_MJ__ADVANCED' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__GZIP_COMPRESSION'), 'input_blob' => $lists['wml.gzip']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__REMOVE_UNSUPPORTED_TAGS'), 'input_blob' => $lists['wml.removetags']))), array('COM_MJ__TEMPLATE_MODULES' => array(), 'COM_MJ__TEMPLATE_OPTIONS' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__MODULE_WMLCARDS', 'COM_MJ__MODULE_WMLCARDS_DESC'), 'input_blob' => $lists['wml.cards'])))), 'COM_MJ__CHTML_SETTINGS' => array(array('COM_MJ__SETTINGS' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__TEMPLATE_NAME', 'COM_MJ__TEMPLATE_NAME_CHTML_DESC'), 'input_blob' => $lists['chtml.template'])), 'COM_MJ__HOMEPAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__FORCED_HOMEPAGE', 'COM_MJ__FORCED_HOMEPAGE_DESC', 'chtml.homepage'), 'input_blob' => JHtml::_('mjconfig.textinput', 'chtml.homepage', $MobileJoomla_Settings['chtml.homepage'])), array('input_blob' => JHtml::_('mjconfig.menulist', $lists['menuoptions'], 'chtml.homepage', $MobileJoomla_Settings['chtml.homepage'])), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__COMPONENT_ON_HOMEPAGE', 'COM_MJ__COMPONENT_ON_HOMEPAGE_DESC'), 'input_blob' => $lists['chtml.componenthome'])), 'COM_MJ__IMAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__IMAGE_ADAPTATION_METHOD', 'COM_MJ__IMAGE_ADAPTATION_METHOD_DESC'), 'input_blob' => $lists['chtml.img']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__DECREASE_IMAGE_WIDTH', 'COM_MJ__DECREASE_IMAGE_WIDTH_DESC', 'chtml.buffer_width'), 'input_blob' => JHtml::_('mjconfig.textinput', 'chtml.buffer_width', $MobileJoomla_Settings['chtml.buffer_width'], 5, array('style' => 'text-align:right')))), 'COM_MJ__ADVANCED' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__GZIP_COMPRESSION'), 'input_blob' => $lists['chtml.gzip']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__REMOVE_UNSUPPORTED_TAGS'), 'input_blob' => $lists['chtml.removetags']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__CONVERT_HTMLENTITIES', 'COM_MJ__CONVERT_HTMLENTITIES_DESC'), 'input_blob' => $lists['chtml.entitydecode']))), array('COM_MJ__TEMPLATE_MODULES' => array(), 'COM_MJ__TEMPLATE_OPTIONS' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__DOCTYPE_HEAD'), 'input_blob' => $lists['chtml.doctype'])))), 'COM_MJ__ADVANCED_SETTINGS' => array(array('COM_MJ__PERFORMANCE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__CACHING', 'COM_MJ__CACHING_DESC'), 'input_blob' => $lists['caching']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__BROWSER_CACHING', 'COM_MJ__BROWSER_CACHING_DESC'), 'input_blob' => $lists['httpcaching']), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__GZIP_COMPRESSION'), 'input_blob' => $lists['global.gzip'])), 'COM_MJ__IMAGE' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__PC_TEMPLATE_WIDTH', 'COM_MJ__PC_TEMPLATE_WIDTH_DESC', 'templatewidth'), 'input_blob' => JHtml::_('mjconfig.textinput', 'templatewidth', $MobileJoomla_Settings['templatewidth'], 5, array('style' => 'text-align:right'))), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__STYLE_IMAGE_SIZE', 'COM_MJ__STYLE_IMAGE_SIZE_DESC'), 'input_blob' => $lists['global.img_addstyles'])), 'COM_MJ__COMPATIBILITY' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__REMOVE_UNSUPPORTED_TAGS'), 'input_blob' => $lists['global.removetags']))), array('COM_MJ__EXTMANAGER' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__EXTS_MANAGER', 'COM_MJ__EXTS_MANAGER_DESC'), 'input_blob' => '<p>' . '<a class="modal button" href="index.php?option=com_mobilejoomla&extmanager=view_modules" rel="{handler:\'iframe\',size:{x:760,y:480}}">Modules</a>' . ' <span style="padding:0 2em">&nbsp;</span> ' . '<a class="modal button" href="index.php?option=com_mobilejoomla&extmanager=view_plugins" rel="{handler:\'iframe\',size:{x:760,y:480}}">Plugins</a>' . '</p>')), 'COM_MJ__DOMAIN_NAME' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__DESKTOP_URL', 'COM_MJ__DESKTOP_URL_DESC', 'desktop_url'), 'input_blob' => JHtml::_('mjconfig.textinput', 'desktop_url', $MobileJoomla_Settings['desktop_url'])), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__PAGE_FOR_PC', 'COM_MJ__PAGE_FOR_PC_DESC', 'pcpage'), 'input_blob' => JHtml::_('mjconfig.textinput', 'pcpage', $MobileJoomla_Settings['pcpage']))), 'COM_MJ__REDIRECT_TO_DOMAIN' => array(array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__XHTMLMP_DOMAIN', 'COM_MJ__DOMAIN_NAME_XHTMLMP_DESC', 'xhtml.domain'), 'input_blob' => JHtml::_('mjconfig.textinput', 'xhtml.domain', $MobileJoomla_Settings['xhtml.domain'])), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__IPHONE_DOMAIN', 'COM_MJ__DOMAIN_NAME_IPHONE_DESC', 'iphone.domain'), 'input_blob' => JHtml::_('mjconfig.textinput', 'iphone.domain', $MobileJoomla_Settings['iphone.domain'])), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__WML_DOMAIN', 'COM_MJ__DOMAIN_NAME_WML_DESC', 'wml.domain'), 'input_blob' => JHtml::_('mjconfig.textinput', 'wml.domain', $MobileJoomla_Settings['wml.domain'])), array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__CHTML_DOMAIN', 'COM_MJ__DOMAIN_NAME_CHTML_DESC', 'chtml.domain'), 'input_blob' => JHtml::_('mjconfig.textinput', 'chtml.domain', $MobileJoomla_Settings['chtml.domain']))))));
     if (count(self::$selftest_blob)) {
         array_unshift_assoc($config_blobs['COM_MJ__GENERAL_SETTINGS'][1], self::$selftest_blob, 'COM_MJ__SELFTEST_WARNINGS');
     }
     if (count($lists['dbsize'])) {
         $text = '';
         foreach ($lists['dbsize'] as $plugin) {
             $title = $plugin[0];
             if (is_int($plugin[1]) || ctype_digit($plugin[1])) {
                 $size = number_format($plugin[1] / (1024 * 1024), 2, '.', '') . ' Mb';
             } else {
                 $size = $plugin[1];
             }
             $date = isset($plugin[2]) ? '<i>' . $plugin[2] . '</i>' : '';
             $text .= "<p>{$title} {$date} &nbsp; [{$size}]</p>";
         }
     } else {
         $text = 'N/A';
     }
     $config_blobs['COM_MJ__GENERAL_SETTINGS'][1]['COM_MJ__INFORMATION'][] = array('label_blob' => JHtml::_('mjconfig.label', 'COM_MJ__DEVICE_DATABASE_SIZE'), 'input_blob' => $text);
     $tplmod_devices = array('COM_MJ__XHTMLMP_SETTINGS' => 'xhtml', 'COM_MJ__IPHONE_SETTINGS' => 'iphone', 'COM_MJ__WML_SETTINGS' => 'wml', 'COM_MJ__CHTML_SETTINGS' => 'chtml');
     $tplmod_sections = array('COM_MJ__MODULE_ABOVE_PATHWAY' => 'header', 'COM_MJ__MODULE_BETWEEN_PATHWAY_COMPONENT' => 'middle', 'COM_MJ__MODULE_BELOW_COMPONENT' => 'footer');
     //template modules
     foreach ($tplmod_devices as $device => $deviceconfig) {
         foreach ($tplmod_sections as $section => $sectionconfig) {
             for ($i = 1; $i <= 3; ++$i) {
                 $config_blobs[$device][1]['COM_MJ__TEMPLATE_MODULES'][] = array('label_blob' => JHtml::_('mjconfig.label', "{$section}_{$i}"), 'input_blob' => $lists["{$deviceconfig}.{$sectionconfig}{$i}"]);
             }
         }
     }
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onMJDisplayConfig', array(&$config_blobs, &$MobileJoomla_Settings, $lists));
     include JPATH_COMPONENT . '/admin_tpl/config_tabs.php';
 }
Ejemplo n.º 7
0
 function simulator_onMJDisplayConfig(&$config_blobs, &$MobileJoomla_Settings, $lists)
 {
     $devices = array('COM_MJ__XHTMLMP_SETTINGS' => array('Samsung Galaxy Nexus' => "size:{x:299,y:470}"), 'COM_MJ__IPHONE_SETTINGS' => array('iPhone 4S' => "size:{x:320,y:416}"), 'COM_MJ__WML_SETTINGS' => array('Nokia 3510i' => "size:{x:121,y:66}"), 'COM_MJ__CHTML_SETTINGS' => array('NEC N341i' => "size:{x:162,y:179}"));
     foreach ($devices as $section => $deviceinfo) {
         $skiplabel = false;
         $rows = array();
         foreach ($deviceinfo as $model => $modalopts) {
             $row = array();
             if (!$skiplabel) {
                 $row['label_blob'] = '<div class="mjpro">' . JHtml::_('mjconfig.prolabel', 'COM_MJ__DEVICE') . '</div>';
             }
             $row['input_blob'] = "<div class=\"mjpro\"><a href=\"javascript:return false;\">{$model}</a></div>";
             $rows[] = $row;
             $skiplabel = true;
         }
         array_unshift_assoc($config_blobs[$section][1], $rows, 'COM_MJ__PREVIEW');
     }
 }
Ejemplo n.º 8
0
function get_dropdown($p_control_array, $p_control_name, $p_match = '', $p_add_any = false, $p_multiple = false, $p_change_script = '')
{
    $t_control_array = $p_control_array;
    if ($p_multiple) {
        $t_size = ' SIZE="5"';
        $t_multiple = ' MULTIPLE';
    } else {
        $t_size = '';
        $t_multiple = '';
    }
    $t_script = $p_change_script == '' ? '' : ' onchange="' . $p_change_script . '"';
    $t_info = sprintf("<SELECT %s NAME=\"%s\" id=\"%s\"%s%s>", $t_multiple, $p_control_name, $p_control_name, $t_size, $t_script);
    if ($p_add_any) {
        array_unshift_assoc($t_control_array, FILTER_META_ANY, lang_trans('[any]'));
    }
    while (list($t_name, $t_desc) = each($t_control_array)) {
        $t_sel = "";
        if (is_array($p_match)) {
            if (in_array($t_name, array_values($p_match)) || in_array($t_desc, array_values($p_match))) {
                $t_sel = " SELECTED";
            }
        } else {
            if ($t_name === $p_match || $t_desc === $p_match) {
                $t_sel = " SELECTED";
            }
        }
        $t_info .= sprintf("<OPTION%s VALUE=\"%s\">%s", $t_sel, $t_name, $t_desc);
    }
    $t_info .= "</SELECT>\n";
    return $t_info;
}
Ejemplo n.º 9
0
});
</script>

<!-- Load Data Section -->
<?php 
$store_id = isValidID($_GET['store_id']) ? $_GET['store_id'] : 0;
$sql = "SELECT store_name,store_layout FROM {$db_table_stores} WHERE store_id=" . $DB_LINK->addq($store_id, get_magic_quotes_gpc()) . " AND store_user='******'";
$rc = $DB_LINK->Execute($sql);
DBUtils::checkResult($rc, NULL, NULL, $sql);
$store_name = $rc->fields['store_name'];
$store_layout = split(',', $rc->fields['store_layout']);
$sql = "SELECT location_id, location_desc FROM {$db_table_locations}";
$rc = $DB_LINK->Execute($sql);
DBUtils::checkResult($rc, NULL, NULL, $sql);
$locations = DBUtils::createList($rc, 'location_id', 'location_desc');
array_unshift_assoc($locations, 0, "");
// add an empty element to the list
?>
<!-- Navigation section -->
<table cellspacing="0" cellpadding="1" border="0" width="100%">
<tr>
	<td align="left" class="title">
		<?php 
echo $LangUI->_('Store Layout For:  ') . $store_name . "<br>";
?>
	</td>
</tr>
</table>

<form action="./index.php?m=admin&a=stores&dosql=update_layout" id="layoutForm" method="POST">
<input type="hidden" name="store_id" value="<?php 
Ejemplo n.º 10
0
 /**
  * Add an item in first position of an array with a specific key
  */
 public function testArrayUnshiftAssoc()
 {
     $array = ['foo' => 1, 0 => 'bar', '_zoo' => []];
     $this->assertEquals(array_unshift_assoc($array, 'unshifted_key', 'unshifted_value'), ['unshifted_key' => 'unshifted_value', 'foo' => 1, 0 => 'bar', '_zoo' => []]);
 }
 */
$sql = "SELECT l_make AS make, l_id FROM `vehicles` WHERE l_id IN ('" . implode("','", $l_aIds) . "')";
$res = mysqli_query($link, $sql);
if ($res === FALSE) {
    die("\nCould not make query. reason: " . mysqli_error($link));
}
while ($l_aResult = mysqli_fetch_assoc($res)) {
    $l_aOrigin = $l_aResult['make'];
    $l_aData[$l_aResult['l_id']]['name'] = $l_aResult['make'];
    $l_aTranlited = translit($l_aResult['make'], $link);
    if ($l_aTranlited !== false) {
        $l_aData[$l_aResult['l_id']]['translit'] = $l_aTranlited['translit'];
        if (isset($l_aImportantMakers[$l_aResult['make']])) {
            $theCount = $l_aData[$l_aResult['l_id']]['count'];
            unset($l_aData[$l_aResult['l_id']]);
            array_unshift_assoc($l_aData, $l_aResult['l_id'], array('count' => $theCount, 'name' => $l_aResult['make'], 'translit' => $l_aTranlited['translit']));
        }
    } else {
        unset($l_aData[$l_aResult['l_id']]);
    }
}
unset($l_aResult);
mysqli_close($link);
echo "\nBuilding the first file..";
$l_sFortyFourMakersBuffer = '<?php $default_makers = array(';
$l_sFortyFourMakersBufferNew = '<?php $default_makers = array(';
$l_aVehicles_default_makers = array_slice($l_aData, 0, $l_iNumOfMakers);
usort($l_aVehicles_default_makers, 'sort_by_name');
foreach ($l_aVehicles_default_makers as $makerCounter => &$maker) {
    $l_sFortyFourMakersBuffer .= "'{$makerCounter}' => array('origin'=>'" . $maker['name'] . "', 'translit'=>'" . $maker['translit'] . "', 'count'=>'" . $maker['count'] . "', 'link'=>'http://auto." . BASE_DOMAIN . "/search/?mk=" . $maker['translit'] . "'),";
    $l_sFortyFourMakersBufferNew .= "'{$makerCounter}'=>array(";