示例#1
0
	function prepare()
	{
		// Prepare JS
		$this->ownerDocument->head
			->a(new LPC_HTML_script("//tinymce.cachefly.net/4.0/tinymce.min.js"), "TinyMCE")
			->a(new LPC_HTML_script(LPC_js."/LPC_HTML_editor.js"), "LPC HTML editor");

		// Prepare textarea
		$this->textarea->setUID();
		$this->a($this->textarea);

		// Prepare controls
		$controlsDiv = new LPC_HTML_node();
		$this->a($controlsDiv);
		$checkbox = new LPC_HTML_node('input');
		$controlsDiv->a($checkbox);
		$checkbox->setUID();
		$checkbox->setAttrs(array(
			'type' => 'checkbox',
			'onChange' => "LPC_HTML_editor.showHideHandle(this, '".$this->textarea->id."')",
		));
		$label = new LPC_HTML_node("label");
		$controlsDiv->a($label);
		$label->setAttr("for", $checkbox->id);
		$label->a(" ".__L('scaffoldingUseHtmlEditor'));
		if ($this->init) {
			$js = new LPC_HTML_script();
			$js->a("$(document).ready(function() { LPC_HTML_editor.initAndShow($('#".$checkbox->id."').get(0), '".$this->textarea->id."'); });");
			$this->a($js);
		}
	}
示例#2
0
文件: LPC_Menu.php 项目: Gutza/LPC
	function __construct($page)
	{
		// CSS
		$page->head->a(new LPC_HTML_link('stylesheet','text/css',LPC_css."/superfish.css"),"Superfish CSS");

		// JavaScript
		$page->head->a(new LPC_HTML_script(LPC_js."/jquery.js"),"jQuery JavaScript");
		$page->head->a(new LPC_HTML_script(LPC_js."/superfish.js"),"Superfish JavaScript");
		$page->head->a(new LPC_HTML_script(LPC_js."/hoverIntent.js"),"HoverIntent JavaScript");

		$js=new LPC_HTML_script();
		$js->a("jQuery(function(){ jQuery('ul.sf-menu').superfish(); });");
		$page->head->a($js,"Superfish init");
	}
示例#3
0
	public function prepare()
	{
		$this->ownerDocument->content['head']->content['LPC list filter CSS']=new LPC_HTML_link('stylesheet','text/css',LPC_css."/LPC_list_filter.css");

		$default=addslashes($this->getCurrentValue());

		$form=new LPC_HTML_form(false,'get');
		$this->searchForm=$form;
		$this->a($form);
		foreach($_GET as $key=>$value) {
			if ($key==$this->GET_key)
				continue;
			$form->a("<input type='hidden' name='$key' value=\"".addslashes($value)."\">");
		}

		$table=new LPC_HTML_node('table');
		$table->setAttr('class','table_filter');
		$form->a($table, 'filterTable');

		$tr=new LPC_HTML_node('tr');
		$table->a($tr, 'filterTR');

		$td=new LPC_HTML_node('td');
		$td->setAttr('class','table_filter');
		$tr->a($td, 'filterTD');
		$td->a("<input type='hidden' name='".$this->listObject->getParam('p')."' value='1'>");

		$td=new LPC_HTML_node('td');
		$td->setAttr('class','table_filter');
		$tr->a($td, 'filterControls');
		$td->a(
			"<button type='submit' style='border: none; background: none; padding: 0px'>".
			$this->getIcon("search", _LS('lpcFilterIcon'))."
			</button>"
		);
		if (strlen($default))
			$td->a(
				"<a href='".LPC_URI::getCurrent()->delVar($this->GET_key)->toString()."'>".
				$this->getIcon("remove", _LS('lpcRemoveFilterIcon')).
				"</a>"
			);

		if (isset($this->helpKey)) {
			$td->a(
				"<a href='#' onClick='alert(".self::JS_translation_var.".".$this->helpKey."); return false;'>".
				$this->getIcon("info").
				"</a>"
			);
			if (!isset($this->ownerDocument->content['head']->content['JS_help_'.$this->helpKey])) {
				$js=new LPC_HTML_script();
				$this->ownerDocument->content['head']->content['JS_help_'.$this->helpKey]=$js;
				$js->a("
if (typeof ".self::JS_translation_var." == 'undefined')
	var ".self::JS_translation_var." = {};
".self::JS_translation_var.".".$this->helpKey."=\"".str_replace("\n","\\n",str_replace("\r","",addslashes(_LS($this->helpKey))))."\";
				");
			}
		}
	}