示例#1
0
    list($name, $link) = explode(TAB, $v);
    $apps[$link] = intl_get($name);
    unset($apps[$k]);
    if ($c == 0) {
        $short = array_shift(explode('-', $link));
        $first_icon = array('href' => site_prefix() . '/index/' . $link, 'src' => site_prefix() . '/inc/app/' . $short . '/pix/icon.gif', 'alt' => intl_get($name));
        if (!@file_exists('inc/app/' . $short . '/pix/icon.gif')) {
            $first_icon['src'] = site_prefix() . '/inc/app/cms/pix/default_icon.gif';
        }
    } elseif ($c == 1) {
        $short = array_shift(explode('-', $link));
        $second_icon = array('href' => site_prefix() . '/index/' . $link, 'src' => site_prefix() . '/inc/app/' . $short . '/pix/icon.gif', 'alt' => intl_get($name));
        if (!@file_exists('inc/app/' . $short . '/pix/icon.gif')) {
            $second_icon['src'] = site_prefix() . '/inc/app/cms/pix/default_icon.gif';
        }
    }
    $c++;
}
//$apps = array_merge (array ('' => '- ' . intl_get ('Choose') . ' -'), $apps);
$split = ceil(count($apps) / 2);
$one = array_slice($apps, 0, $split);
$two = array_slice($apps, $split);
$data['app_panel'] = array('name' => 'app', 'caption' => intl_get('Tools'), 'action' => '', 'method' => 'get', 'select' => 'list', 'selected' => '', 'select-extra' => 'onchange="this.form.action = \'' . site_prefix() . '/index/\' + this.options[this.selectedIndex].value; this.form.submit ()"', 'options' => array($one, $two), 'icons' => array($first_icon, $second_icon, array('href' => site_prefix() . '/index/cms-admintools-icons-action', 'src' => site_prefix() . '/inc/app/cms/pix/icons/more.gif', 'alt' => intl_get('More'))));
if (!appconf('panels_show_disabled') && count($apps) < 2) {
    array_pop($data['app_panel']['icons']);
}
//loader_import ('saf.HTML');
page_add_script(site_prefix() . '/js/dropmenu.js');
template_bind('/html/body', template_simple('layout/panels.spt', $data));
echo '<br clear="both" />
<p style="padding-bottom: 60px">&nbsp;</p>';
示例#2
0
 /**
  * Adds a link tag to the global template.
  *
  * @param string
  * @param string
  * @param string
  * @param string
  * @param string
  */
 function addLink($rel, $type, $href, $charset = false, $hreflang = false, $name = false)
 {
     $link = '<link rel="' . $rel . '" type="' . $type . '" href="' . $href . '"';
     if ($charset) {
         $link .= ' charset="' . $charset . '"';
     }
     if ($hreflang) {
         $link .= ' hreflang="' . $hreflang . '"';
     }
     if ($name) {
         $link .= ' title="' . $name . '"';
     }
     $link .= ' />' . NEWLINE;
     template_bind('/html/head', $link);
 }
示例#3
0
    function display($generate_html = 0)
    {
        parent::display($generate_html);
        global $intl, $simple, $cgi;
        // needs browser check to display textarea as alternative
        $this->initial_value = $this->formatValue($this->data_value);
        $this->scroller_data = $this->formatValue($this->scroller_data);
        if ($this->reference !== false) {
            if (empty($this->reference)) {
                $this->reference = '<br />';
            }
            $this->reference = $this->formatValue($this->reference);
        }
        loader_import('ext.phpsniff');
        $ua = new phpSniff();
        if ($ua->property('browser') == 'ie' && $ua->property('platform') == 'win' && $ua->property('version') >= '5.5' || $ua->property('browser') == 'mz' && $ua->property('version') >= '1.3' || $ua->property('browser') == 'ns' && $ua->property('version') >= '5.0' || $ua->property('browser') == 'fb' && $ua->property('version') >= '0.7' || $ua->property('browser') == 'ca' && $ua->property('version') >= '1.0' || $ua->property('browser') == 'sf' && $ua->property('version') >= '522' || strpos($ua->property('ua'), 'adobeair')) {
            // go xed
            if ($ua->property('browser') == 'ie') {
                $this->msie = true;
                if ($ua->property('version') >= '7.0') {
                    $this->msie7 = 'true';
                }
            }
            if ($ua->property('browser') == 'sf') {
                $this->safari = 'true';
            } elseif (strpos($ua->property('ua'), 'adobeair')) {
                $this->safari = 'true';
                $this->adobeair = 'true';
            }
            if (@file_exists('inc/html/' . conf('Server', 'default_template_set') . '/images.php')) {
                if ($cgi->_collection) {
                    $collection = $cgi->_collection;
                } elseif ($cgi->collection) {
                    $collection = $cgi->collection;
                } else {
                    $collection = false;
                }
                if ($collection) {
                    $images = ini_parse('inc/html/' . conf('Server', 'default_template_set') . '/images.php');
                    if (isset($images[$collection])) {
                        $this->max_height = $images[$collection]['max_height'];
                        $this->max_width = $images[$collection]['max_width'];
                        if ($images[$collection]['popup']) {
                            $this->img_popup = 'true';
                        } else {
                            $this->img_popup = 'false';
                        }
                    } else {
                        $this->max_height = 'false';
                        $this->max_width = 'false';
                        $this->img_popup = 'false';
                    }
                } else {
                    $this->max_height = 'false';
                    $this->max_width = 'false';
                    $this->img_popup = 'false';
                }
            } else {
                $this->max_height = 'false';
                $this->max_width = 'false';
                $this->img_popup = 'false';
            }
            // initialize modal dialog event handlers
            page_onload('xed_init (\'' . $this->name . '\')');
            page_onclick('checkModal ()');
            page_onfocus('return checkModal ()');
            template_bind('/html/body', '	<form style="display: inline" id="xed-' . $this->name . '-fsform" method="post" action="' . site_prefix() . '/index/xed-fullscreen-form" target="xedFullscreenWindow">
		<input type="hidden" name="ifname" value="' . $this->name . '" />
		<input type="hidden" name="xeditor" value="" />
	</form>');
            $this->templates = db_fetch_array('select * from xed_templates');
            foreach ($this->templates as $k => $t) {
                $this->templates[$k]->body = $this->formatValue($t->body);
            }
            $this->source_height = $this->height + 2;
            loader_import('saf.GUI.Prompt');
            $template = join('', file('inc/app/xed/html/xed.spt'));
            return template_simple($template, $this);
        } else {
            // return a textarea
            return '<tr><td class="field" colspan="2"><textarea name="' . $this->name . '" cols="50" rows="10">' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td></tr>';
        }
    }