本文整理汇总了PHP中album::get_sort_order_options方法的典型用法代码示例。如果您正苦于以下问题:PHP album::get_sort_order_options方法的具体用法?PHP album::get_sort_order_options怎么用?PHP album::get_sort_order_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类album
的用法示例。
在下文中一共展示了album::get_sort_order_options方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _get_form
private function _get_form()
{
$form = new Forge("admin/default_sort", "", "post", array("id" => "g-admin-default_sort-form"));
$group = $form->group("sort_order")->label(t("Sort Order"));
$group->dropdown("sort_column")->id(t("sort_column"))->label(t("Sort by"))->options(array_merge(array("none" => t("None")), album::get_sort_order_options()))->selected(module::get_var("default_sort", "default_sort_column", "none"));
$group->dropdown("sort_direction")->id(t("sort_direction"))->label(t("Sort by"))->options(array("none" => t("None"), "ASC" => t("Ascending"), "DESC" => t("Descending")))->selected(module::get_var("default_sort", "default_sort_direction", "none"));
$form->submit("submit")->value(t("Save"));
return $form;
}
示例2: get_edit_form
static function get_edit_form($parent)
{
$form = new Forge("albums/update/{$parent->id}", "", "post", array("id" => "g-edit-album-form"));
$form->hidden("from_id")->value($parent->id);
$group = $form->group("edit_item")->label(t("Edit Album"));
$group->input("title")->label(t("Title"))->value($parent->title)->error_messages("required", t("You must provide a title"))->error_messages("length", t("Your title is too long"));
$group->textarea("description")->label(t("Description"))->value($parent->description);
if ($parent->id != 1) {
$group->input("name")->label(t("Directory Name"))->value($parent->name)->error_messages("conflict", t("There is already a movie, photo or album with this name"))->error_messages("no_slashes", t("The directory name can't contain a \"/\""))->error_messages("no_trailing_period", t("The directory name can't end in \".\""))->error_messages("required", t("You must provide a directory name"))->error_messages("length", t("Your directory name is too long"));
$group->input("slug")->label(t("Internet Address"))->value($parent->slug)->error_messages("conflict", t("There is already a movie, photo or album with this internet address"))->error_messages("not_url_safe", t("The internet address should contain only letters, numbers, hyphens and underscores"))->error_messages("required", t("You must provide an internet address"))->error_messages("length", t("Your internet address is too long"));
} else {
$group->hidden("name")->value($parent->name);
$group->hidden("slug")->value($parent->slug);
}
$sort_order = $group->group("sort_order", array("id" => "g-album-sort-order"))->label(t("Sort Order"));
$sort_order->dropdown("column", array("id" => "g-album-sort-column"))->label(t("Sort by"))->options(album::get_sort_order_options())->selected($parent->sort_column);
$sort_order->dropdown("direction", array("id" => "g-album-sort-direction"))->label(t("Order"))->options(array("ASC" => t("Ascending"), "DESC" => t("Descending")))->selected($parent->sort_order);
module::event("item_edit_form", $parent, $form);
$group = $form->group("buttons")->label("");
$group->hidden("type")->value("album");
$group->submit("")->value(t("Modify"));
return $form;
}
示例3: t
<?php
echo $micro_thumb_grid;
?>
</ul>
</div>
<div id="g-organize-controls" class="ui-widget-header">
<a id="g-organize-close" href="#" ref="done"
class="g-button g-right ui-corner-all ui-state-default"><?php
echo t("Close");
?>
</a>
<form>
<?php
echo t("Sort order");
?>
<?php
echo form::dropdown(array("id" => "g-organize-sort-column"), album::get_sort_order_options(), $album->sort_column);
?>
<?php
echo form::dropdown(array("id" => "g-organize-sort-order"), array("ASC" => "Ascending", "DESC" => "Descending"), $album->sort_order);
?>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$("#g-organize").ready($.organize.init);
</script>
示例4: sort_order
function sort_order($album_id, $col, $dir)
{
access::verify_csrf();
$album = ORM::factory("item", $album_id);
access::required("view", $album);
access::required("edit", $album);
$options = album::get_sort_order_options();
if (!isset($options[$col])) {
return;
}
$album->sort_column = $col;
$album->sort_order = $dir;
$album->save();
print json_encode(array("grid" => self::_get_micro_thumb_grid($album, 0)->__toString(), "sort_column" => $album->sort_column, "sort_order" => $album->sort_order));
}
示例5: foreach
?>
+ '</span>',
'<div class="icon"></div>',
'</div>',
'</tpl>',
'</tpl>')
});
/*
* ********************************************************************************
* Toolbar with sort column, sort order, delete and close buttons.
* ********************************************************************************
*/
sort_order_data = [];
<? foreach (album::get_sort_order_options() as $key => $value): ?>
sort_order_data.push(["<?php
echo $key;
?>
", <?php
echo $value->for_js();
?>
]);
<? endforeach ?>
var sort_column_combobox = new Ext.form.ComboBox({
mode: "local",
editable: false,
allowBlank: false,
forceSelection: true,
triggerAction: "all",
flex: 3,
示例6: get_edit_form
static function get_edit_form($parent)
{
$form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gEditAlbumForm"));
$form->hidden("_method")->value("put");
$group = $form->group("edit_item")->label(t("Edit Album"));
$group->input("title")->label(t("Title"))->value($parent->title);
$group->textarea("description")->label(t("Description"))->value($parent->description);
if ($parent->id != 1) {
$group->input("dirname")->label(t("Directory Name"))->value($parent->name)->rules("required")->error_messages("name_conflict", t("There is already a photo or album with this name"))->callback("item::validate_no_slashes")->error_messages("no_slashes", t("The directory name can't contain a \"/\""))->callback("item::validate_no_trailing_period")->error_messages("no_trailing_period", t("The directory name can't end in \".\""));
$group->input("slug")->label(t("Internet Address"))->value($parent->slug)->error_messages("slug_conflict", t("There is already a photo or album with this internet address"))->callback("item::validate_url_safe")->error_messages("not_url_safe", t("The internet address should contain only letters, numbers, hyphens and underscores"));
}
$sort_order = $group->group("sort_order", array("id" => "gAlbumSortOrder"))->label(t("Sort Order"));
$sort_order->dropdown("column", array("id" => "gAlbumSortColumn"))->label(t("Sort by"))->options(album::get_sort_order_options())->selected($parent->sort_column);
$sort_order->dropdown("direction", array("id" => "gAlbumSortDirection"))->label(t("Order"))->options(array("ASC" => t("Ascending"), "DESC" => t("Descending")))->selected($parent->sort_order);
module::event("item_edit_form", $parent, $form);
$group = $form->group("buttons")->label("");
$group->hidden("type")->value("album");
$group->submit("")->value(t("Modify"));
$form->add_rules_from(ORM::factory("item"));
return $form;
}