static function head($theme)
 {
     // Load fotomoto's js file on photo and album pages.
     if ($theme->page_subtype == "photo" || $theme->page_subtype == "album") {
         return html::script('http://widget.fotomoto.com/stores/script/' . module::get_var("fotomotorw", "fotomoto_site_key") . '.js?api=true');
     }
 }
Ejemplo n.º 2
0
 public static function header($form = array())
 {
     if (isset($form['template'])) {
         form::$template = arr::take('template', $form);
     }
     $attrs['class'] = isset($form['class']) ? $form['class'] : 'form';
     $attrs['method'] = isset($form['method']) ? $form['method'] : 'post';
     $attrs['action'] = isset($form['action']) ? $form['action'] : url::current();
     //加载表头
     $html[] = '';
     $html[] = '<form' . html::attributes($attrs) . '>';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
     $html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
     //加载常用js
     $html[] = html::script(url::common() . '/js/jquery.validate.js');
     $html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
     $html[] = html::script(url::common() . '/js/jquery.form.js');
     //表单头部
     if (isset($form['title']) || isset($form['description'])) {
         $html[] = '<div class="form-header clearfix">';
         $html[] = isset($form['icon']) ? '		<div class="form-icon"></div>' : '';
         $html[] = isset($form['title']) ? '		<div class="form-title">' . $form['title'] . '</div>' : '';
         $html[] = isset($form['description']) ? '		<div class="form-description">' . $form['description'] . '</div>' : '';
         $html[] = '</div>';
     }
     //表单body部分开始
     $html[] = '<div class="form-body">';
     echo implode("\n", $html);
 }
Ejemplo n.º 3
0
 function codemirror($attrs)
 {
     $url = zotop::module('codemirror', 'url');
     $options = new stdClass();
     $options->path = $url . '/codemirror/js/';
     $options->parserfile = array('parsexml.js');
     $options->stylesheet = array($url . '/codemirror/css/xmlcolors.css');
     $options->height = is_numeric($attrs['height']) ? $attrs['height'] . 'px' : $attrs['height'];
     $options->width = is_numeric($attrs['width']) ? $width . 'px' : $attrs['width'];
     $options->continuousScanning = 500;
     $options->autoMatchParens = true;
     if ($attrs['linenumbers'] !== false) {
         $options->lineNumbers = true;
         $options->textWrapping = false;
     }
     if ($attrs['tabmode'] == '') {
         $options->tabMode = 'shift';
     }
     $html = array();
     $html[] = html::script($url . '/codemirror/js/codemirror.js');
     $html[] = html::stylesheet($url . '/codemirror/css/codemirror.css');
     $html[] = '	' . field::textarea($attrs);
     $html[] = '<script type="text/javascript">';
     $html[] = '	var editor = CodeMirror.fromTextArea("' . $attrs['name'] . '", ' . json_encode($options) . ');';
     $html[] = '$(function(){';
     $html[] = '	$("form").submit(function(){';
     $html[] = '		$("textarea[name=+' . $attrs['name'] . '+]").val(editor.getCode());';
     $html[] = '	});';
     $html[] = '})';
     $html[] = '</script>';
     return implode("\n", $html);
 }
Ejemplo n.º 4
0
 static function admin_head($theme)
 {
     $head = array();
     if (strpos(Router::$current_uri, "admin/users") !== false) {
         $head[] = html::script("lib/gallery.panel.js");
     }
     return implode("\n", $head);
 }
Ejemplo n.º 5
0
Archivo: FB.php Proyecto: anqqa/Anqh
 /**
  * Initializes Facebook Connect
  */
 public static function init()
 {
     widget::add('foot', html::script(array('js/fbconnect.js', 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US')));
     widget::add('foot', html::script_source("FB.init('" . FB::$config['api_key'] . "');"));
     // Add logged in Facebook user id to session for easier access
     if ($logged_in = FB::instance()->get_loggedin_user()) {
         $_SESSION['fb_uid'] = $logged_in;
     }
 }
Ejemplo n.º 6
0
 static function head($theme)
 {
     // @tdo remove the addition css and organize.js (just here to test)
     $script[] = html::script("modules/organize/js/organize_init.js");
     $script[] = html::script("modules/organize/js/organize.js");
     $script[] = "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/organize/css/organize.css") . "\" />";
     return implode("\n", $script);
     //return html::script("modules/organize/js/organize_init.js");
 }
Ejemplo n.º 7
0
 public function render($template = "forge_template", $custom = false)
 {
     $script = array();
     if (!empty($this->data["url"])) {
         $script[] = html::script($this->data["url"]);
     }
     if (!empty($this->data["text"])) {
         $script[] = "<script type=\"text/javascript\">\n{$this->data['text']}\n</script>\n";
     }
     return implode("\n", $script);
 }
Ejemplo n.º 8
0
 public static function render($print = FALSE)
 {
     $output = '';
     foreach (self::$scripts as $script) {
         $output .= html::script($script);
     }
     if ($print) {
         echo $output;
     }
     return $output;
 }
Ejemplo n.º 9
0
 public static function source($attrs)
 {
     $html = array();
     $html[] = '';
     $html[] = '<div style="height:460px;overflow:hidden;">';
     $html[] = '<div id="SourceEditorPannel">正在加载编辑器,请稍后……</div>';
     $html[] = html::script(url::common() . '/js/swfobject.js');
     $html[] = html::script(url::module() . '/admin/js/file.js');
     $html[] = field::textarea($attrs);
     $html[] = '</div>';
     return implode("\n", $html);
 }
Ejemplo n.º 10
0
 static function head($theme)
 {
     $buf = "";
     if (Session::instance()->get("debug")) {
         $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("core/css/debug.css") . "\" />";
     }
     if ($theme->page_type == "album" && access::can("edit", $theme->item())) {
         $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("core/css/quick.css") . "\" />";
         $buf .= html::script("core/js/quick.js");
     }
     return $buf;
 }
Ejemplo n.º 11
0
 public static function header($header = array())
 {
     $attrs['class'] = isset($header['class']) ? $header['class'] : 'form';
     $attrs['method'] = isset($header['method']) ? $header['method'] : 'post';
     $attrs['action'] = isset($header['action']) ? $header['action'] : url::current();
     $html[] = '';
     $html[] = '<form' . html::attributes($attrs) . '>';
     $html[] = isset($header['title']) ? '<div class="form-title">' . $header['title'] . '</div>' : '';
     $html[] = isset($header['title']) ? '<div class="form-description">' . $header['description'] . '</div>' : '';
     $html[] = html::script(url::theme() . '/js/jquery.form.js');
     $html[] = html::script(url::theme() . '/js/zotop.form.js');
     echo implode("\n", $html);
 }
Ejemplo n.º 12
0
 static function admin_head($theme)
 {
     $head = array();
     if (strpos(Router::$current_uri, "admin/server_add") !== false) {
         $head[] = "<link media=\"screen, projection\" rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("lib/jquery.autocomplete.css") . "\" />";
         $base = url::site("__ARGS__");
         $csrf = access::csrf_token();
         $head[] = "<script> var base_url = \"{$base}\"; var csrf = \"{$csrf}\";</script>";
         $head[] = html::script("lib/jquery.autocomplete.js");
         $head[] = html::script("modules/server_add/js/admin.js");
     }
     return implode("\n", $head);
 }
Ejemplo n.º 13
0
 static function admin_head($theme)
 {
     $session = Session::instance();
     $buf = "";
     if ($session->get("debug")) {
         $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/debug.css") . "\" />";
     }
     if ($session->get("l10n_mode", false)) {
         $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/l10n_client.css") . "\" />";
         $buf .= html::script("lib/jquery.cookie.js");
         $buf .= html::script("modules/gallery/js/l10n_client.js");
     }
     return $buf;
 }
Ejemplo n.º 14
0
	/**
	 * Adds all the events to the main Ushahidi application
	 */
	public function add()
	{
		// Add JS for Map Settings Page
		$api_url_all = Kohana::config('settings.api_url_all');
		$api_url_all .= html::script(url::base().'plugins/cloudmade/views/js/cloudmade.js');
		Kohana::config_set('settings.api_url_all', $api_url_all);
		
		// Add a Sub-Nav Link
		Event::add('ushahidi_filter.map_base_layers', array($this, '_add_layer'));
		
		// Reconfigure the default map api
		if (Kohana::config('settings.default_map') == "cloudmade")
		{
			Kohana::config_set('settings.api_url', "<script type=\"text/javascript\" src=\"".url::base()."plugins/cloudmade/views/js/cloudmade.js\"></script>" );
		}
	}
Ejemplo n.º 15
0
 public static function header($header = array())
 {
     if (isset($header['template'])) {
         form::$template = arr::take('template', $header);
     }
     $attrs['class'] = isset($header['class']) ? $header['class'] : 'form';
     $attrs['method'] = isset($header['method']) ? $header['method'] : 'post';
     $attrs['action'] = isset($header['action']) ? $header['action'] : url::current();
     $html[] = '';
     $html[] = '<form' . html::attributes($attrs) . '>';
     $html[] = isset($header['title']) ? '<div class="form-title">' . $header['title'] . '</div>' : '';
     $html[] = isset($header['description']) ? '<div class="form-description">' . $header['description'] . '</div>' : '';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
     $html[] = html::script(url::common() . '/js/jquery.validate.js');
     $html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
     $html[] = html::script(url::common() . '/js/jquery.form.js');
     $html[] = html::script(url::common() . '/js/zotop.form.js');
     echo implode("\n", $html);
 }
Ejemplo n.º 16
0
 function xheditor_rc1($attrs)
 {
     $attrs['class'] = isset($attrs['class']) ? 'editor ' . $attrs['class'] : 'editor';
     $tools = array('image' => '<a href="' . zotop::url('system/image/upload') . '" class="button editor-insert" name="' . $attrs['name'] . '"><span class="zotop-icon zotop-icon-imageuploader button-icon"></span><span class="button-text">插入图片</span></a>', 'file' => '<a href="' . zotop::url('system/file/upload') . '" class="button editor-insert" name="' . $attrs['name'] . '"><span class="zotop-icon zotop-icon-fileuploader button-icon"></span><span class="button-text">插入文件</span></a>', 'template' => '<a href="' . zotop::url('system/file/upload') . '" class="button editor-insert" name="' . $attrs['name'] . '"><span class="zotop-icon zotop-icon-template button-icon"></span><span class="button-text">插入模板</span></a>');
     $tools = zotop::filter('editor.tools', $tools);
     $tools = arr::take('tools', $attrs) === false ? array() : $tools;
     $url = zotop::module('xheditor', 'url');
     $html[] = html::script($url . '/editor/xheditor-zh-cn.min.js');
     $html[] = html::script($url . '/common/global.js');
     if (is_array($tools) && !empty($tools)) {
         $html[] = '<div class="field-toolbar">';
         foreach ($tools as $tool) {
             $html[] = ' ' . $tool;
         }
         $html[] = '</div>';
     }
     $html[] = '	' . field::textarea($attrs);
     return implode("\n", $html);
 }
Ejemplo n.º 17
0
 public function header()
 {
     $header = $this->render('header');
     if (!$header) {
         $javascript = (array) $this->js;
         $css = (array) $this->css;
         $metas = (array) $this->meta;
         $html[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
         $html[] = '<html xmlns="http://www.w3.org/1999/xhtml">';
         $html[] = '<head>';
         $html[] = '	<title>' . $this->title . ' ' . zotop::config("zotop.title") . '</title>';
         $html[] = '	' . html::meta('keywords', $this->keywords . ' ' . zotop::config("zotop.keywords"));
         $html[] = '	' . html::meta('description', $this->description . ' ' . zotop::config("zotop.description"));
         $html[] = '	' . html::meta('Content-Type', 'text/html;charset=utf-8');
         $html[] = '	' . html::meta('X-UA-Compatible', 'IE=EmulateIE7');
         foreach ($metas as $meta) {
             $html[] = '	' . html::meta($meta);
         }
         $html[] = '	' . html::stylesheet('$theme/css/zotop.css', array('id' => 'zotop'));
         $html[] = '	' . html::stylesheet('$theme/css/global.css', array('id' => 'global'));
         foreach ($css as $stylesheet) {
             $html[] = '	' . html::stylesheet($stylesheet);
         }
         $html[] = '	' . html::script('$common/js/jquery.js', array('id' => 'jquery'));
         $html[] = '	' . html::script('$common/js/jquery.plugins.js', array('id' => 'plugins'));
         $html[] = '	' . html::script('$common/js/zotop.js', array('id' => 'zotop'));
         $html[] = '	' . html::script('$common/js/global.js', array('id' => 'global'));
         foreach ($javascript as $js) {
             $html[] = '	' . html::script($js);
         }
         $html[] = '	' . html::link('$theme/image/favicon.ico', array('rel' => 'shortcut icon', 'type' => 'image/x-icon'));
         $html[] = '	' . html::link('$theme/image/favicon.ico', array('rel' => 'icon', 'type' => 'image/x-icon'));
         $html[] = '	' . html::link('$theme/image/favicon.ico', array('rel' => 'bookmark', 'type' => 'image/x-icon'));
         $html[] = '</head>';
         $html[] = '<body' . html::attributes($this->body) . '>';
         $html[] = '<div id="wrapper">';
         $html[] = '<div id="page">';
         $html[] = '';
         $header = implode("\n", $html);
     }
     echo $header;
 }
Ejemplo n.º 18
0
 public function header()
 {
     $javascript = (array) $this->js;
     $css = (array) $this->css;
     $metas = (array) $this->meta;
     $html[] = '<!DOCTYPE html>';
     $html[] = '<html>';
     $html[] = '<head>';
     $html[] = '	<title>' . $this->title . ' ' . zotop::config("zotop.title") . '</title>';
     $html[] = '	' . html::meta('keywords', $this->keywords . ' ' . zotop::config("zotop.keywords"));
     $html[] = '	' . html::meta('description', $this->description . ' ' . zotop::config("zotop.description"));
     $html[] = '	' . html::meta('Content-Type', 'text/html;charset=utf-8');
     $html[] = '	' . html::meta('X-UA-Compatible', 'IE=EmulateIE7');
     foreach ($metas as $meta) {
         $html[] = '	' . html::meta($meta);
     }
     $html[] = '	' . html::stylesheet('$theme/css/zotop.css', array('id' => 'zotop'));
     $html[] = '	' . html::stylesheet('$theme/css/global.css', array('id' => 'global'));
     foreach ($css as $stylesheet) {
         $html[] = '	' . html::stylesheet($stylesheet);
     }
     $html[] = '	' . html::script('$common/js/jquery.js', array('id' => 'jquery'));
     $html[] = '	' . html::script('$common/js/jquery.plugins.js', array('id' => 'plugins'));
     $html[] = '	' . html::script('$common/js/zotop.js', array('id' => 'zotop'));
     $html[] = '	' . html::script('$common/js/global.js', array('id' => 'global'));
     foreach ($javascript as $js) {
         $html[] = '	' . html::script($js);
     }
     $html[] = '	' . html::link('$theme/image/favicon.ico', array('rel' => 'shortcut icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link('$theme/image/favicon.ico', array('rel' => 'icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link('$theme/image/favicon.ico', array('rel' => 'bookmark', 'type' => 'image/x-icon'));
     $html[] = '</head>';
     $html[] = '<body' . html::attributes($this->body) . '>';
     $html[] = '<div id="wrapper">';
     $html[] = '<div id="container" class="clearfix">';
     $html[] = '';
     echo implode("\n", $html);
 }
Ejemplo n.º 19
0
    public static function jlib()
    {
        if (@$_GET['AJAX_NO_LOAD'] == 'TRUE') {
            return null;
        }
        $str = null;
        $jsdir = Kohana::config('fpp_config.directory_js');
        $str .= "\n    <script type='text/javascript'>\n      baseurl= '" . url::base(FALSE) . "';\n      var BASE_OPENW = baseurl+'{$jsdir}openwysiwyg/';\n    </script>";
        $str .= html::script(array($jsdir . 'jquery-1.3.2.min.js', $jsdir . 'ui.core.js', $jsdir . 'jui/js/jquery-ui-1.7.2.custom.min.js', $jsdir . 'jquerylib.js', $jsdir . 'timepicker.js', $jsdir . 'i18n/ui.datepicker-es.js', $jsdir . 'jquery.prettyPhoto.js', $jsdir . 'ui.spinner.js', $jsdir . 'openwysiwyg/scripts/openwysiwyg.modified.js', $jsdir . 'openwysiwyg/scripts/wysiwyg-settings.js'));
        $str .= html::stylesheet(array($jsdir . 'jui/css/le-frog/jquery-ui-1.7.2.custom.css', $jsdir . 'ui.spinner.css', $jsdir . 'prettyphoto/css/prettyPhoto.css'));
        $str .= <<<EOF
<style type="text/css">
  /*demo page css*/
  body.nostyles{ font: 62.5% "Trebuchet MS", sans-serif; margin: 50px;}
  .demoHeaders { margin-top: 2em; }
  #dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
  #dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
  ul#icons {margin: 0; padding: 0; width:30px;}
  ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}
  ul#icons span.ui-icon {float: left; margin: 0 4px;}
</style>
<script type='text/javascript'>
\$(document).ready(function(){
  \$('#dialog_link, ul#icons li').hover(
    function() { \$(this).addClass('ui-state-hover'); }, 
    function() { \$(this).removeClass('ui-state-hover'); }
  );
  \$("input[name\$='boleta_factura']").change(function(){
    var current = \$(this).val();
    \$(".area-boleta-factura").hide();
    \$("#area-"+current).show(800);
  });
})
</script>
EOF;
        return $str;
    }
Ejemplo n.º 20
0
    echo "<script type=\"text/javascript\">jQuery.noConflict()</script>";
    echo html::script('media/js/protochart/prototype', true);
    echo '<!--[if IE]>';
    echo html::script('media/js/protochart/excanvas-compressed', true);
    echo '<![endif]-->';
    echo html::script('media/js/protochart/ProtoChart', true);
}
if ($allow_feed == 1) {
    echo "<link rel=\"alternate\" type=\"application/rss+xml\" href=\"http://" . $_SERVER['SERVER_NAME'] . "/feed/\" title=\"RSS2\" />";
}
//Custom stylesheet
echo html::stylesheet(url::base() . 'themes/' . $site_style . "/style.css");
echo html::stylesheet(url::base() . 'media/css/jquery-ui-1.7.2.custom.css');
echo html::script('media/js/jquery-1.3.2.min', true);
echo html::script('media/js/ui.core.js', true);
echo html::script('media/js/ui.slider.js', true);
?>
	
	<style type="text/css">
		#demo-frame > div.demo { padding: 10px !important; };
	</style>
	<script type="text/javascript">
$(function() {
		$("#slider-range").slider({
			range: true,
			min: 0,
			max: 100,
			<?php 
if (isset($_SESSION['veracity_min']) && isset($_SESSION['veracity_max'])) {
    echo "\tvalues: [" . $_SESSION['veracity_min'] . " , " . $_SESSION['veracity_max'] . " ],";
} else {
Ejemplo n.º 21
0
    // The only reason we include prototype is to keep the div element naming convention consistent
    //echo html::script('media/js/protochart/prototype', true);
    echo html::script('media/js/raphael', true);
    echo '<script type="text/javascript" charset="utf-8">';
    echo 'var impact_json = { ' . $impact_json . ' };';
    echo '</script>';
    echo html::script('media/js/raphael-ushahidi-impact', true);
}
// Load ColorPicker
if ($colorpicker_enabled) {
    echo html::stylesheet('media/css/colorpicker', '', true);
    echo html::script('media/js/colorpicker', true);
}
// Load TinyMCE
if ($editor_enabled) {
    echo html::script('media/js/tinymce/tiny_mce', true);
}
?>
	<script type="text/javascript" charset="utf-8">
		<?php 
echo $js . "\n";
?>
		function info_search(){
			$("#info-search").submit();
		}
	</script>
</head>
<body>
	<div class="holder">
		<!-- header -->
		<div id="header">
Ejemplo n.º 22
0
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php 
echo Kohana::lang('ui_main.login');
?>
</title>
<?php 
echo html::stylesheet(url::file_loc('css') . 'media/css/jquery-ui-themeroller', '', TRUE);
echo html::stylesheet(url::file_loc('css') . 'media/css/login', '', TRUE);
echo html::stylesheet(url::file_loc('css') . 'media/css/openid', '', TRUE);
echo html::stylesheet(url::file_loc('css') . 'media/css/global', '', TRUE);
echo html::stylesheet(url::file_loc('css') . 'themes/peace/css/_global.css', '', TRUE);
echo html::script(url::file_loc('js') . 'media/js/jquery', TRUE);
echo html::script(url::file_loc('js') . 'media/js/openid/openid-jquery', TRUE);
echo html::script(url::file_loc('js') . 'media/js/openid/openid-jquery-en', TRUE);
echo html::script(url::file_loc('js') . 'media/js/global', TRUE);
?>
<script type="text/javascript">
	<?php 
echo $js;
?>
</script>
</head>

<body>

<?php 
echo $header_nav;
?>

<div id="openid_login_container">
Ejemplo n.º 23
0
 public function signup()
 {
     $this->template->header->this_body = '';
     $this->template->content = new View('mhi/mhi_signup');
     $this->template->header->js .= new View('mhi/mhi_signup_js');
     $this->template->header->js_files = array(html::script('media/js/mhi/initialize', true));
     $this->template->content->site_name = Kohana::config('settings.site_name');
     $this->template->content->domain_name = $_SERVER['HTTP_HOST'] . Kohana::config('config.site_domain');
     $session = Session::instance();
     $this->template->content->logged_in = $session->get('mhi_user_id');
 }
Ejemplo n.º 24
0
		</div>
		<div id="end" class="content">

<?php 
echo widget::get('end');
?>

		</div>
	</footer><!-- #footer -->

	<!-- /FOOTER -->


<?php 
echo html::script(array('js/jquery.autocomplete.pack.js', 'js/jquery.form.js', 'js/jquery.text-overflow.js'));
?>

<script>
//<![CDATA[
$(function() {

	// Form input hints
	$('input:text, textarea, input:password').hint('hint');


	// Ellipsis ...
	$('.cut li').ellipsis();


	// Delete confirmations
Ejemplo n.º 25
0
    echo html::script(url::file_loc('js') . 'media/js/colorpicker', true);
}
// Load TinyMCE
if ($editor_enabled) {
    echo html::script(url::file_loc('js') . 'media/js/tinymce/tiny_mce', true);
}
// Table Row Sort
if ($tablerowsort_enabled) {
    echo html::script(url::file_loc('js') . 'media/js/jquery.tablednd_0_5', true);
}
// JSON2 for IE+
if ($json2_enabled) {
    echo html::script(url::file_loc('js') . 'media/js/json2', true);
}
// Turn on picbox
echo html::script(url::file_loc('js') . 'media/js/picbox', true);
echo html::stylesheet(url::file_loc('css') . 'media/css/picbox/picbox');
// Render CSS and Javascript Files from Plugins
echo plugin::render('stylesheet');
echo plugin::render('javascript');
// Action::header_scripts_admin - Additional Inline Scripts
Event::run('ushahidi_action.header_scripts_admin');
?>
	<script type="text/javascript" charset="utf-8">
		<?php 
echo $js . "\n";
?>
		function info_search(){
			$("#info-search").submit();
		}
		function show_addedit(toggle){
 /**
  * Process template and write to stdOut
  *
  * @param string HTML template
  * @param string Base for absolute paths
  */
 public function _write($templ = '', $base_path = '')
 {
     $output = trim($templ);
     if (empty($output)) {
         $output = $this->default_template;
         $is_empty = true;
     }
     // set default page title
     if (empty($this->pagetitle)) {
         $this->pagetitle = 'Roundcube Mail';
     }
     // replace specialchars in content
     $page_title = html::quote($this->pagetitle);
     $page_header = '';
     $page_footer = '';
     // include meta tag with charset
     if (!empty($this->charset)) {
         if (!headers_sent()) {
             header('Content-Type: text/html; charset=' . $this->charset);
         }
         $page_header = '<meta http-equiv="content-type"';
         $page_header .= ' content="text/html; charset=';
         $page_header .= $this->charset . '" />' . "\n";
     }
     // definition of the code to be placed in the document header and footer
     if (is_array($this->script_files['head'])) {
         foreach ($this->script_files['head'] as $file) {
             $page_header .= html::script($file);
         }
     }
     $head_script = $this->scripts['head_top'] . $this->scripts['head'];
     if (!empty($head_script)) {
         $page_header .= html::script(array(), $head_script);
     }
     if (!empty($this->header)) {
         $page_header .= $this->header;
     }
     // put docready commands into page footer
     if (!empty($this->scripts['docready'])) {
         $this->add_script('$(document).ready(function(){ ' . $this->scripts['docready'] . "\n});", 'foot');
     }
     if (is_array($this->script_files['foot'])) {
         foreach ($this->script_files['foot'] as $file) {
             $page_footer .= html::script($file);
         }
     }
     if (!empty($this->footer)) {
         $page_footer .= $this->footer . "\n";
     }
     if (!empty($this->scripts['foot'])) {
         $page_footer .= html::script(array(), $this->scripts['foot']);
     }
     // find page header
     if ($hpos = stripos($output, '</head>')) {
         $page_header .= "\n";
     } else {
         if (!is_numeric($hpos)) {
             $hpos = stripos($output, '<body');
         }
         if (!is_numeric($hpos) && ($hpos = stripos($output, '<html'))) {
             while ($output[$hpos] != '>') {
                 $hpos++;
             }
             $hpos++;
         }
         $page_header = "<head>\n<title>{$page_title}</title>\n{$page_header}\n</head>\n";
     }
     // add page hader
     if ($hpos) {
         $output = substr_replace($output, $page_header, $hpos, 0);
     } else {
         $output = $page_header . $output;
     }
     // add page footer
     if (($fpos = strripos($output, '</body>')) || ($fpos = strripos($output, '</html>'))) {
         $output = substr_replace($output, $page_footer . "\n", $fpos, 0);
     } else {
         $output .= "\n" . $page_footer;
     }
     // add css files in head, before scripts, for speed up with parallel downloads
     if (!empty($this->css_files) && !$is_empty && (($pos = stripos($output, '<script ')) || ($pos = stripos($output, '</head>')))) {
         $css = '';
         foreach ($this->css_files as $file) {
             $css .= html::tag('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $file, 'nl' => true));
         }
         $output = substr_replace($output, $css, $pos, 0);
     }
     $output = $this->parse_with_globals($this->fix_paths($output));
     // trigger hook with final HTML content to be sent
     $hook = $this->app->plugins->exec_hook("send_page", array('content' => $output));
     if (!$hook['abort']) {
         if ($this->charset != RCUBE_CHARSET) {
             echo rcube_charset::convert($hook['content'], RCUBE_CHARSET, $this->charset);
         } else {
             echo $hook['content'];
         }
     }
 }
Ejemplo n.º 27
0
Archivo: forum.php Proyecto: anqqa/Anqh
 /**
  * Edit topic
  *
  * @param  mixed  $topic_id
  * @param  mixed  $area_id
  */
 public function _topic_edit($topic_id, $area_id = false)
 {
     $this->history = false;
     $errors = array();
     $forum_topic = new Forum_Topic_Model((int) $topic_id);
     $forum_area = $forum_topic->loaded() ? $forum_topic->forum_area : new Forum_Area_Model((int) $area_id);
     if ($forum_topic->loaded()) {
         // Editing topic
         $editing = true;
         if (!$forum_topic->has_access(Forum_Topic_Model::ACCESS_EDIT)) {
             url::back('forum');
         }
     } else {
         if ($forum_area->loaded()) {
             // New topic
             $editing = false;
             if (!$forum_area->has_access(Forum_Area_Model::ACCESS_WRITE)) {
                 url::back('forum');
             }
         } else {
             // New topic in unknown area
             $errors[] = __('Area :area or topic :topic not found', array(':area' => (int) $area_id, ':topic' => (int) $topic_id));
         }
     }
     if (empty($errors)) {
         $forum_post = new Forum_Post_Model((int) $forum_topic->first_post_id);
         $form_errors = array();
         $form_values_topic = $forum_topic->as_array();
         $form_values_post = $forum_post->as_array();
         $form_topics = false;
         // Bound area?
         if ($forum_area->is_type(Forum_Area_Model::TYPE_BIND)) {
             // Get bind config and load topics
             $bind = Forum_Area_Model::binds($forum_area->bind);
             if ($editing) {
                 // Can't edit bound topic
                 $form_topics = array($forum_topic->bind_id => $forum_topic->name);
             } else {
                 // Try to load options from configured model
                 try {
                     $bind_topics = ORM::factory($bind['model'])->find_bind_topics($forum_area->bind);
                     $form_topics = array(0 => __('Choose..')) + $bind_topics;
                 } catch (Kohana_Exception $e) {
                     $form_topics = array();
                 }
             }
         }
         // Admin actions
         if ($editing && $forum_topic->has_access(Forum_Topic_Model::ACCESS_DELETE)) {
             $this->page_actions[] = array('link' => url::model($forum_topic) . '/delete/?token=' . csrf::token(), 'text' => __('Delete topic'), 'class' => 'topic-delete');
         }
         // Check post
         if ($post = $this->input->post()) {
             $post['forum_area_id'] = $forum_area->id;
             $topic = $post;
             if (isset($bind_topics)) {
                 $topic['name'] = arr::get($bind_topics, (int) $topic['bind_id'], '');
             }
             $post_extra = $topic_extra = array('author_id' => $this->user->id, 'author_name' => $this->user->username);
             if ($editing) {
                 $post_extra['modifies'] = (int) $forum_post->modifies + 1;
                 $post_extra['modified'] = date::unix2sql(time());
             }
             $post_extra['author_ip'] = $this->input->ip_address();
             $post_extra['author_host'] = $this->input->host_name();
             // validate post first and save topic if ok
             if (csrf::valid() && $forum_post->validate($post, false, $post_extra) && $forum_topic->validate($topic, true, $topic_extra)) {
                 // post
                 $forum_post->forum_topic_id = $forum_topic->id;
                 $forum_post->save();
                 if (!$editing) {
                     // topic
                     $forum_topic->first_post_id = $forum_post->id;
                     $forum_topic->last_post_id = $forum_post->id;
                     $forum_topic->last_poster = $this->user->username;
                     $forum_topic->last_posted = date::unix2sql(time());
                     $forum_topic->posts = 1;
                     $forum_topic->save();
                     // area
                     $forum_area->last_topic_id = $forum_topic->id;
                     $forum_area->posts += 1;
                     $forum_area->topics += 1;
                     $forum_area->save();
                     // user
                     $this->user->posts += 1;
                     $this->user->save();
                     // News feed
                     newsfeeditem_forum::topic($this->user, $forum_topic);
                 }
                 // redirect back to topic
                 URL::redirect(url::model($forum_topic));
             } else {
                 $form_errors = array_merge($post->errors(), is_object($topic) ? $topic->errors() : array());
             }
             $form_values_topic = arr::overwrite($form_values_topic, is_object($topic) ? $topic->as_array() : $topic);
             $form_values_post = arr::overwrite($form_values_post, $post->as_array());
         }
     }
     // Show form
     if (empty($errors)) {
         $this->breadcrumb[] = html::anchor(url::model($forum_area), text::title($forum_area->name));
         $this->page_title = $editing ? text::title($forum_topic->name) : __('New topic');
         $this->page_subtitle = __('Area :area', array(':area' => html::anchor(url::model($forum_area), text::title($forum_area->name), array('title' => strip_tags($forum_area->description)))));
         widget::add('head', html::script(array('js/jquery.markitup.pack', 'js/markitup.bbcode')));
         widget::add('main', View_Mod::factory('forum/topic_edit', array('topic' => $form_values_topic, 'topics' => $form_topics, 'post' => $form_values_post, 'errors' => $form_errors)));
     } else {
         $this->_error(__('Error'), $errors);
     }
     $this->_side_views();
 }
Ejemplo n.º 28
0
<div class="box">
	<big><b><?php 
echo html::anchor($kwalbum_url . '/~admin', 'Admin Options');
?>
: Editing Tags</b></big>

<table border="1">
	<tr><th>Count</th><th style="width:255px;">Name</th><th>Delete?</th></tr>
<?php 
$tags = Model_Kwalbum_Tag::getAllArray();
foreach ($tags as $tag) {
    echo "\t<tr id='row{$tag['id']}'><td>" . html::anchor($kwalbum_url . '/tags/' . $tag['name'], $tag['count']) . "</td><td><span id='tag{$tag['id']}'>{$tag['name']}</span></td><td style='text-align:center'>" . "<a href='#' onClick='deleteTag({$tag['id']});return false;'>[X]</a></td></tr>";
}
echo "</table></div>";
echo html::script($kwalbum_url . '/media/ajax/jquery.jeditable.mini.js');
?>
<script type="text/javascript">
function deleteTag(id){
	if (confirm('You are about to permanently delete "'+$('#tag'+id).text()+'"')){
			$.post("<?php 
echo $kwalbum_url;
?>
/~ajaxAdmin/DeleteTag", {id:id},function(){$('#row'+id).hide();});
			$('#tag'+id).text('deleting...');
	}
}
<?php 
foreach ($tags as $tag) {
    ?>
	$('#tag<?php 
    echo $tag['id'];
Ejemplo n.º 29
0
</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <?php 
foreach ($styles as $file_style) {
    ?>
            <?php 
    echo html::style($file_style);
    ?>
        <?php 
}
?>
        <?php 
foreach ($scripts as $file_script) {
    ?>
            <?php 
    echo html::script($file_script);
    ?>
        <?php 
}
?>
</head>
<body>
   
<div id="wrapper">
   
    <div id="header">
        
        <div id="headerCont">
            
            <h1><?php 
echo $site_name;
Ejemplo n.º 30
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
?>


<?php 
echo html::script(array(url::base() . 'media/js/fckeditor/fckeditor.js'), FALSE);
?>
<script type="text/javascript">
window.onload = function()
{
	// Automatically calculates the editor base path based on the _samples directory.
	// This is usefull only for these samples. A real application should use something like this:
	// oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
	var sBasePath = '<?php 
echo url::base();
?>
/media/js/fckeditor/';

	var oFCKeditor = new FCKeditor( 'categoryDescription' ) ;
	oFCKeditor.Width = '100%' ;
	oFCKeditor.Height = '512' ; 
	oFCKeditor.BasePath	= sBasePath ;
	oFCKeditor.ReplaceTextarea() ;	
	
	var oFCKeditor = new FCKeditor( 'categoryShortDescription' ) ;
	oFCKeditor.Width = '100%' ;
	oFCKeditor.Height = '300' ; 
	oFCKeditor.BasePath	= sBasePath ;
	oFCKeditor.ReplaceTextarea() ;