本文整理汇总了PHP中G::js方法的典型用法代码示例。如果您正苦于以下问题:PHP G::js方法的具体用法?PHP G::js怎么用?PHP G::js使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::js方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sortFieldForm
function sortFieldForm($elementName = "")
{
global $jQueryLib, $gorumroll;
JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
JavaScript::addInclude(GORUM_JS_DIR . "/jquery/form.js");
JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.center.js");
// to center the loading animation image
JavaScript::addInclude(JS_DIR . "/sort_custom_fields.js");
JavaScript::addInclude(JS_DIR . "/propagate.js");
// Propagate into all other categories:
$propagatePostfix = OverlayController::addPropagateOverlay($gorumroll->rollid, "_sorting");
// Propagate into the subcategories only:
if ($gorumroll->rollid) {
getDbCount($count, array("SELECT COUNT(*) FROM @category WHERE up=#cid#", $gorumroll->rollid));
if ($count) {
$propagatePostfix .= " " . OverlayController::addPropagateOverlay($gorumroll->rollid, "_sorting", "_subcat");
}
}
JavaScript::addOnload("\n \$('#itemfield-sortfield_form .submitfooter').append(" . G::js($propagatePostfix) . ");\n ");
$this->showHtmlList($elementName);
}
示例2: addPropagateOverlay
function addPropagateOverlay($id, $what = "", $how = "")
{
global $lll;
$class = $what == "_cat" ? "cat" : "itemfield";
$ctrl =& new AppController("{$class}/propagate{$what}{$how}/{$id}");
// Ajax target
$url = $ctrl->makeUrl();
$overlay =& new OverlayController(array("content" => GenerWidget::generConfirmation($lll["confirmation"], $lll["propagateConfirmationText{$what}{$how}"]), "id" => "overlay{$how}", "height" => 160, "expose" => TRUE, "close" => "div.close, input.confirmation_cancel, input.confirmation_continue", "onBeforeLoad" => "\$.noah.propagateOnBeforeLoad(this, " . G::js("processing", "continue", $url) . ");", "onClose" => "\$.noah.propagateOnClose(this, " . G::js("confirmation", "propagateConfirmationText{$what}{$how}", "cancel") . ");"));
return " <a rel='#overlay{$how}' href='' title='" . $lll["propagateLabel{$what}{$how}"] . "'><img class='propagate{$how}' src='" . IMAGES_DIR . "/propagate{$how}.png' width='20' border=0></a>";
}
示例3: handleCategorySelect
function handleCategorySelect($tableId)
{
global $gorumroll, $jQueryLib;
JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
JavaScript::addInclude(JS_DIR . "/categoryselect.js");
if ($this->cascadingCategorySelectEnabled() && !$gorumroll->rollid && $gorumroll->list != "customlist") {
$ctrl =& new AppController("cat/get_one_level_of_categories");
// Ajax target
$url = $ctrl->makeUrl();
JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.livequery.js");
JavaScript::addScript("\$JQ.noah.addNextSelectRow(" . G::js($url, "subCategory", $tableId) . ");");
JavaScript::addOnload("\$.noah.cascadingSelectOnLoad('{$tableId}');");
} elseif (!$this->cascadingCategorySelectEnabled() || $gorumroll->list == "customlist") {
JavaScript::addOnload("\$.noah.simpleCategoryReload();");
}
}
示例4: showSelector
function showSelector($what)
{
global $lll;
$_S =& new AppSettings();
if (!$_S->{"allowSelect{$what}"}) {
return "";
}
$labels = array($lll["change{$what}"]);
$values = array("0");
$allowedItems = explode(",", $_S->{"allowed{$what}s"});
foreach ($allowedItems as $item) {
$values[$item] = $item;
if (isset($lll["allowed{$what}s_{$item}"])) {
$labels[$item] = $lll["allowed{$what}s_{$item}"];
} else {
$labels[$item] = str_replace("_", " ", $item);
}
}
JavaScript::addInclude(GORUM_JS_DIR . "/cookie.js");
$base = Controller::getBaseUrl();
JavaScript::addOnload("\$.noah.themeSelectorWidget(" . G::js($what, $base) . ")");
return GenerWidget::generSelectField("{$what}SelectorWidget", $labels, $values, "{$what}SelectorWidget", "0");
}
示例5: setupCustomListAppearance
function setupCustomListAppearance($elementName)
{
global $lll, $item_typ, $jQueryLib, $curvyCorners, $gorumroll;
// ha tobb item list is van egy oldalon, mindegyiknek teljesen kulonbozo typeinfo-ja lehet:
include "item_typ.php";
// resetting $item_typ
CustomField::addCustomColumns("item");
$lll["item_search_ttitle"] = htmlspecialchars($this->listTitle);
$columns = $gorumroll->list == "export" ? $this->exportFields : $this->columns;
G::load($columns, "SELECT * FROM @itemfield WHERE FIND_IN_SET(id, '{$columns}')!=0");
$item = new Item();
$item_typ["listOrder"] = array();
foreach (explode(",", $this->columns) as $id) {
for ($i = 0; $i < count($columns); $i++) {
if ($columns[$i]->id == $id) {
$columns[$i]->showInList = 1;
if (!$columns[$i]->customListPlacement) {
$item_typ["listOrder"][] = $columns[$i]->columnIndex;
}
$item_typ["attributes"][$columns[$i]->columnIndex][] = "list";
if ($columns[$i]->customListPlacement) {
$item_typ["attributes"][$columns[$i]->columnIndex][] = "customListPlacement";
}
break;
}
}
}
$item->fields =& $columns;
$item->cid = $this->cid;
$item->activateVariableFields();
$item->fields = 0;
CustomList::getSortingSql($this->primarySort, $this->primaryDir, $this->primaryPersistent, $this->secondarySort, $this->secondaryDir, $this->secondaryPersistent);
if ($specialSortAttrs = $item->getSpecialSortAttrs($this->cid ? 0 : 1, $this->cid)) {
$this->query = str_replace("n.*", "n.* {$specialSortAttrs}", $this->query);
}
if ($this->limit) {
$item_typ["limit"] = $this->limit;
}
if ($this->listStyle != customlist_scrollable && $gorumroll->list != "export") {
$_S =& new AppSettings();
if ($this->customAdListTemplate) {
$item_typ["listTemplate"] = $this->customAdListTemplate;
} elseif ($_S->customAdListTemplate) {
$item_typ["listTemplate"] = $_S->customAdListTemplate;
}
}
//var_dump($item_typ);
if ($this->listStyle == customlist_scrollable && $gorumroll->list != "export") {
// Neheny szajton, az orientattiont egyszeruen nem tudtam a typeInfoban atvinni a
// item_scrollablepresentationbe - kenytelen voltan globalba tenni:
global $scrollablePlacement, $orientation;
if (!isset($item_typ["listTemplate"])) {
$item_typ["listTemplate"] = "scrollable_widget.tpl.php";
}
$item_typ["listPresentationClassName"] = "ItemScrollablePresentation";
$params = "";
$scrollablePlacement = $elementName;
if ($elementName == "customListLeft" || $elementName == "customListRight") {
$item_typ["scrollableOrientation"] = $orientation = "vertical";
$scrollableParams = "vertical: true";
} else {
$scrollableParams = "vertical: false";
$item_typ["scrollableOrientation"] = $orientation = "horizontal";
}
if ($this->loop) {
$scrollableParams .= ", loop: true";
}
include_once NOAH_APP . "/item_scrollablepresentation.php";
JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.dimensions.js");
JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.center.js");
JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.scrollable.js");
JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.em.js");
JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.jscrollpane.js");
JavaScript::addInclude(JS_DIR . "/scrollable.js");
JavaScript::addCss(CSS_DIR . "/scrollable.css");
JavaScript::addCss(GORUM_JS_DIR . "/jquery/jscrollpane.css");
JavaScript::addOnload("\$.noah.globalScrollableOnLoad();", "scrollable");
JavaScript::addOnload("\$.noah.scrollableOnLoad(" . G::js($this->id, $elementName, $scrollableParams) . ");");
if ($this->autoScroll) {
JavaScript::addOnload("\$.noah.autoscrollOnLoad(" . G::js($this->id, $elementName, $this->autoScroll) . ");");
}
}
}