本文整理汇总了PHP中Forge::group方法的典型用法代码示例。如果您正苦于以下问题:PHP Forge::group方法的具体用法?PHP Forge::group怎么用?PHP Forge::group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forge
的用法示例。
在下文中一共展示了Forge::group方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Forge
static function get_edit_form_admin()
{
$form = new Forge("admin/theme_options/save/", "", null, array("id" => "g-theme-options-form"));
$group = $form->group("requirements")->label("Prerequisites checklist");
$group->checkbox("shadowbox")->label(t("Shadowbox module"))->checked(module::is_active("shadowbox"))->disabled(true);
$file = THEMEPATH . "greydragon/theme.info";
$theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
$group = $form->group("edit_theme")->label(t("Grey Dragon Theme") . " - " . t("v.") . $theme_info->version);
$group->input("row_count")->label(t("Rows per album page"))->id("g-page-size")->rules("required|valid_digit")->value(module::get_var("gallery", "page_size") / 3);
$group->input("resize_size")->label(t("Resized image size (in pixels)"))->id("g-resize-size")->rules("required|valid_digit")->value(module::get_var("gallery", "resize_size"));
$group->checkbox("build_resize")->label(t("Mark to build all resizes (from Maintenace page)"))->id("g-build-resize")->value(false);
$group->checkbox("build_thumbs")->label(t("Mark to build all thumbnails (200x200) (from Maintenace page)"))->id("g-build-thumb")->value(false);
$group->checkbox("photonav_top")->label(t("Show top photo navigator"))->checked(module::get_var("th_greydragon", "photonav_top"));
$group->checkbox("photonav_bottom")->label(t("Show bottom photo navigator"))->checked(module::get_var("th_greydragon", "photonav_bottom"));
$group->dropdown("sidebar_allowed")->label(t("Allowed SideBar Positions"))->options(array("any" => t("Any"), "left" => t("Left"), "right" => t("Right"), "none" => t("None")))->selected(module::get_var("th_greydragon", "sidebar_allowed"));
$group->dropdown("sidebar_visible")->label(t("Default SideBar Position"))->options(array("right" => t("Right"), "left" => t("Left"), "none" => t("None")))->selected(module::get_var("th_greydragon", "sidebar_visible"));
$group->input("header_text")->label(t("Header text"))->id("g-header-text")->value(module::get_var("gallery", "header_text"));
$group->input("footer_text")->label(t("Footer text"))->id("g-footer-text")->value(module::get_var("gallery", "footer_text"));
$group->checkbox("show_credits")->label(t("Show site credits"))->id("g-footer-text")->checked(module::get_var("gallery", "show_credits"));
$group->input("copyright")->label(t("Copyright message to display on footer"))->id("g-theme-copyright")->value(module::get_var("th_greydragon", "copyright"));
$group->input("logo_path")->label(t("URL or path to alternate logo image"))->id("g-site-logo")->value(module::get_var("th_greydragon", "logo_path"));
module::event("theme_edit_form", $form);
$group = $form->group("buttons");
$group->submit("")->value(t("Save"));
return $form;
}
示例2: _get_admin_form
private function _get_admin_form()
{
// Make a new Form.
$form = new Forge("admin/exif_gps/saveprefs", "", "post", array("id" => "g-exif-gps-adminForm"));
// Create group for global settings, like the Maps API Key
$gps_global_group = $form->group("Global")->label(t("Global Settings"));
$gps_global_group->input("google_api_key")->label(t("Google Maps API Key"))->value(module::get_var("exif_gps", "googlemap_api_key"))->rules("required");
$gps_global_group->input("max_auto_zoom_level")->label(t("Maximum Auto-Zoom Level:"))->value(module::get_var("exif_gps", "googlemap_max_autozoom"));
$checkbox_user["checkbox_user"] = array(t("Show \"Map this user\" icon?"), module::get_var("exif_gps", "toolbar_map_user"));
$checkbox_album["checkbox_album"] = array(t("Show \"Map this album\" icon?"), module::get_var("exif_gps", "toolbar_map_album"));
$gps_global_group->checklist("toolbar_map_album")->options($checkbox_album);
$gps_global_group->checklist("toolbar_map_user")->options($checkbox_user);
// Create a group for sidebar settings
$gps_sidebar = $form->group("Sidebar")->label(t("Sidebar Settings"));
$gps_sidebar->input("sidebar_default_zoom")->label(t("Default Zoom Level"))->value(module::get_var("exif_gps", "sidebar_zoom"))->rules("required");
$gps_sidebar->dropdown("sidebar_mapformat")->label(t("Map Interface"))->options(array(t("Static"), t("Interactive")))->selected(module::get_var("exif_gps", "sidebar_mapformat"));
$gps_sidebar->dropdown("sidebar_maptype")->label(t("Default Map Type"))->options(array(t("Map"), t("Satellite"), t("Hybrid"), t("Terrain")))->selected(module::get_var("exif_gps", "sidebar_maptype"));
// Create a group for map album/user settings
$gps_large_map_group = $form->group("LargeMap")->label(t("Map Album/User Settings"));
$gps_large_map_group->dropdown("largemap_maptype")->label(t("Default Map Type"))->options(array(t("Map"), t("Satellite"), t("Hybrid"), t("Terrain")))->selected(module::get_var("exif_gps", "largemap_maptype"));
// Add a save button to the form.
$form->submit("SaveSettings")->value(t("Save"));
// Return the newly generated form.
return $form;
}
示例3: _get_admin_form
private function _get_admin_form()
{
$form = new Forge("admin/movie_tools/save", "", "post", array("id" => "g-movie-tools-admin-form"));
$formats = movie_tools::get_formats();
$settings_formats = $form->group("formats")->label(t("Movie format supported"));
foreach ($formats as $id => $data) {
$settings_formats->checkbox($id)->label($data["name"])->checked(module::get_var("movie_tools", "allow_{$id}", false));
}
$settings_formats->input("custom_formats")->label(t("Additional movie formats (enter using the same formatting as the table above)"))->callback(array($this, "_validate_custom_formats"))->error_messages("valid_custom_formats", t("You must enter valid formats like the examples in the table"))->value(movie_tools::formats_json_to_string(module::get_var("movie_tools", "custom_formats", "")));
$settings_thumbs = $form->group("thumbs")->label(t("Movie thumbnails"));
$settings_thumbs->input("extract_frame_time")->label(t("Seconds from start of movie at which thumbnails are extracted (default: 3)"))->rules("required|valid_numeric")->callback(array($this, "_validate_extract_frame_time"))->error_messages("required", t("You must enter a number"))->error_messages("valid_numeric", t("You must enter a number"))->error_messages("valid_min", t("The value cannot be negative"))->value(module::get_var("gallery", "movie_extract_frame_time", 3));
$form->submit("save")->value(t("Save"));
return $form;
}
示例4: _get_form
private function _get_form()
{
$form = new Forge("admin/menu_links/handler", "", "post", array("id" => "g-admin-form"));
$group = $form->group("menu")->label(t("First link on menu"));
$group->input("menu_title")->label(t('Enter the title.'))->value(module::get_var("menu_links", "title"));
$group->input("menu_url")->label(t('Enter the URL of the link.'))->value(module::get_var("menu_links", "url"));
$group = $form->group("menu2")->label(t("Gallery root album title"));
$group->input("menu_title2")->label(t('Enter the title.'))->value(module::get_var("menu_links", "title2", "home"))->rules("required");
$group->checkbox("menu_hidden")->label(t("Hide link"))->checked(module::get_var("menu_links", "hidden", false) == 1);
$group = $form->group("menu3")->label(t("Link after the Gallery root album."));
$group->input("menu_title3")->label(t('Enter the title.'))->value(module::get_var("menu_links", "title3"));
$group->input("menu_url3")->label(t('Enter the URL of the link.'))->value(module::get_var("menu_links", "url3"));
$form->submit("submit")->value(t("Save"));
return $form;
}
示例5: Forge
static function get_email_form($user_id, $item_id = null)
{
// Determine name of the person the message is going to.
$str_to_name = "";
if ($user_id == -1) {
$str_to_name = module::get_var("contactowner", "contact_owner_name");
} else {
// Locate the record for the user specified by $user_id,
// use this to determine the user's name.
$userDetails = ORM::factory("user")->where("id", "=", $user_id)->find_all();
$str_to_name = $userDetails[0]->name;
}
// If item_id is set, include a link to the item.
$email_body = "";
if (!empty($item_id)) {
$item = ORM::factory("item", $item_id);
$email_body = "This message refers to <a href=\"" . url::abs_site("{$item->type}s/{$item->id}") . "\">this page</a>.";
}
// Make a new form with a couple of text boxes.
$form = new Forge("contactowner/sendemail/{$user_id}", "", "post", array("id" => "g-contact-owner-send-form"));
$sendmail_fields = $form->group("contactOwner");
$sendmail_fields->input("email_to")->label(t("To:"))->value($str_to_name)->id("g-contactowner-to-name");
$sendmail_fields->input("email_from")->label(t("From:"))->value(identity::active_user()->email)->id("g-contactowner-from-email")->rules('required|valid_email')->error_messages("required", t("You must enter a valid email address"))->error_messages("valid_email", t("You must enter a valid email address"))->error_messages("invalid", t("You must enter a valid email address"));
$sendmail_fields->input("email_subject")->label(t("Subject:"))->value("")->id("g-contactowner-subject")->rules('required')->error_messages("required", t("You must enter a subject"));
$sendmail_fields->textarea("email_body")->label(t("Message:"))->value($email_body)->id("g-contactowner-email-body")->rules('required')->error_messages("required", t("You must enter a message"));
// Add a captcha, if there's an active captcha module.
module::event("captcha_protect_form", $form);
// Add a save button to the form.
$sendmail_fields->submit("SendMessage")->value(t("Send"));
return $form;
}
示例6: Forge
static function get_delete_form_admin($email_template)
{
$form = new Forge("admin/email_templates/delete_email_template/{$email_template->id}", "", "post", array("id" => "gDeleteEmailTemplateForm"));
$group = $form->group("delete_email_template")->label(t("Are you sure you want to delete Email template %name?", array("name" => $email_template->name)));
$group->submit("")->value(t("Delete Email template %name", array("name" => $email_template->name)));
return $form;
}
示例7: Forge
static function get_delete_form_admin($product)
{
$form = new Forge("admin/product_lines/delete_product/{$product->id}", "", "post", array("id" => "g-delete-product-form"));
$group = $form->group("delete_product")->label(t("Are you sure you want to delete product %name?", array("name" => $product->name)));
$group->submit("")->value(t("Delete product %name", array("name" => $product->name)));
return $form;
}
示例8: emailid
public function emailid($user_id)
{
// Display a form that a vistor can use to contact a registered user.
// If this page is disabled, show a 404 error.
if (module::get_var("contactowner", "contact_user_link") != true) {
kohana::show_404();
}
// Locate the record for the user specified by $user_id,
// use this to determine the user's name.
$userDetails = ORM::factory("user")->where("id", $user_id)->find_all();
// Make a new form with a couple of text boxes.
$form = new Forge("contactowner/sendemail", "", "post", array("id" => "gContactOwnerSendForm"));
$sendmail_fields = $form->group("contactOwner");
$sendmail_fields->input("email_to")->label(t("To:"))->value($userDetails[0]->name);
$sendmail_fields->input("email_from")->label(t("From:"))->value(user::active()->email);
$sendmail_fields->input("email_subject")->label(t("Subject:"))->value("");
$sendmail_fields->textarea("email_body")->label(t("Message:"))->value("");
$sendmail_fields->hidden("email_to_id")->value($user_id);
// Add a save button to the form.
$sendmail_fields->submit("SendMessage")->value(t("Send"));
// Set up and display the actual page.
$template = new Theme_View("page.html", "Contact");
$template->content = new View("contactowner_emailform.html");
$template->content->sendmail_form = $form;
print $template;
}
示例9: _get_admin_form
private function _get_admin_form()
{
// Make a new Form.
$form = new Forge("admin/user_info/saveprefs", "", "post", array("id" => "g-user_info-admin-form"));
// Create the input boxes for the User Information Settings
$user_infoGroup = $form->group("UserInformationSettings");
$user_infoGroup->dropdown("per_page")->label(t("Number of records to display per page"))->options(array("5" => t("5"), "10" => t("10"), "15" => t("15"), "25" => t("25"), "50" => t("50"), "75" => t("75"), "100" => t("100"), "125" => t("125")))->selected(module::get_var("user_info", "per_page"));
$user_infoGroup->dropdown("default_sort_column")->label(t("Default Column to Sort By"))->options(array("id" => t("id"), "user_id" => t("user_id"), "user_name" => t("user_name"), "ip_address" => t("ip_address"), "time_stamp" => t("time_stamp"), "action" => t("action")))->selected(module::get_var("user_info", "default_sort_column"));
$user_infoGroup->dropdown("default_sort_order")->label(t("Default Sort Order"))->options(array("ASC" => t("Ascending"), "DESC" => t("Descending")))->selected(module::get_var("user_info", "default_sort_order"));
$user_infoGroup->dropdown("use_default_gallery_date_format")->label(t("Use Default Gallery Date/Time Format"))->options(array("Yes" => t("Yes"), "No" => t("No")))->selected(module::get_var("user_info", "use_default_gallery_date_format"));
$user_infoGroup->input("date_format")->label(t("Format of the Date & Time - <a href='http://php.net/manual/en/function.date.php' target='_blank'>PHP Date</a>"))->value(module::get_var("user_info", "date_format"));
$user_infoGroup->dropdown("log_logins")->label(t("Log Logins"))->options(array("Yes" => t("Yes"), "No" => t("No")))->selected(module::get_var("user_info", "log_logins"));
$user_infoGroup->input("color_login")->label(t("<font color='%color_login'>Login Color</font> - Hex Only - <a href='http://www.w3schools.com/HTML/html_colornames.asp' target='_blank'>HTML Colors</a>", array("color_login" => module::get_var("user_info", "color_login"))))->value(module::get_var("user_info", "color_login"));
$user_infoGroup->dropdown("log_logouts")->label(t("Log Logouts"))->options(array("Yes" => t("Yes"), "No" => t("No")))->selected(module::get_var("user_info", "log_logouts"));
$user_infoGroup->input("color_logout")->label(t("<font color='%color_logout'>Logout Color</font> - Hex Only - <a href='http://www.w3schools.com/HTML/html_colornames.asp' target='_blank'>HTML Colors</a>", array("color_logout" => module::get_var("user_info", "color_logout"))))->value(module::get_var("user_info", "color_logout"));
$user_infoGroup->dropdown("log_failed_logins")->label(t("Log Failed Logins"))->options(array("Yes" => t("Yes"), "No" => t("No")))->selected(module::get_var("user_info", "log_failed_logins"));
$user_infoGroup->input("color_failed_login")->label(t("<font color='%color_failed_login'>Failed Login Color</font> - Hex Only - <a href='http://www.w3schools.com/HTML/html_colornames.asp' target='_blank'>HTML Colors</a>", array("color_failed_login" => module::get_var("user_info", "color_failed_login"))))->value(module::get_var("user_info", "color_failed_login"));
$user_infoGroup->dropdown("log_re_authenticate_logins")->label(t("Log Re-Authenticate Logins"))->options(array("Yes" => t("Yes"), "No" => t("No")))->selected(module::get_var("user_info", "log_re_authenticate_logins"));
$user_infoGroup->input("color_re_authenticate_login")->label(t("<font color='%color_re_authenticate_login'>Re-Authenticate Login Color</font> - Hex Only - <a href='http://www.w3schools.com/HTML/html_colornames.asp' target='_blank'>HTML Colors</a>", array("color_re_authenticate_login" => module::get_var("user_info", "color_re_authenticate_login"))))->value(module::get_var("user_info", "color_re_authenticate_login"));
$user_infoGroup->dropdown("log_user_created")->label(t("Log User Created"))->options(array("Yes" => t("Yes"), "No" => t("No")))->selected(module::get_var("user_info", "log_user_created"));
$user_infoGroup->input("color_user_created")->label(t("<font color='%color_user_created'>User Created Color</font> - Hex Only - <a href='http://www.w3schools.com/HTML/html_colornames.asp' target='_blank'>HTML Colors</a>", array("color_user_created" => module::get_var("user_info", "color_user_created"))))->value(module::get_var("user_info", "color_user_created"));
// Add a save button to the form.
$form->submit("SaveSettings")->value(t("Save"));
// Return the newly generated form.
return $form;
}
示例10: Forge
static function get_delete_form()
{
$form = new Forge("admin/watermarks/delete", "", "post", array("id" => "g-delete-watermark-form"));
$group = $form->group("delete_watermark")->label(t("Really delete Watermark?"));
$group->submit("")->value(t("Delete"));
return $form;
}
示例11: get
static function get($block_id, $theme)
{
if (identity::active_user()->guest) {
return;
}
$block = "";
switch ($block_id) {
case "untagged_photo":
$attempts = 0;
do {
$item = item::random_query()->join("items_tags", "items.id", "items_tags.item_id", "left")->where("items.type", "!=", "album")->where("items_tags.item_id", "IS", null)->find_all(1)->current();
} while (!$item && $attempts++ < 3);
if ($item && $item->loaded()) {
$block = new Block();
$block->css_id = "g-tag-it-block";
$block->title = t("Tag it");
$block->content = new View("tag_it_block.html");
$block->content->item = $item;
$form = new Forge("tags/create/{$item->id}", "", "post", array("id" => "g-tag-it-add-tag-form", "class" => "g-short-form"));
$label = $item->is_album() ? t("Add tag to album") : ($item->is_photo() ? t("Add tag to photo") : t("Add tag to movie"));
$group = $form->group("add_tag")->label("Add Tag");
$group->input("name")->label($label)->rules("required")->id("name");
$group->hidden("item_id")->value($item->id);
$group->submit("")->value(t("Add Tag"));
$block->content->form = $form;
}
break;
}
return $block;
}
示例12: _get_s3_form
private function _get_s3_form()
{
$form = new Forge("admin/aws_s3", "", "post", array("id" => "g-admin-s3-form"));
$group = $form->group("aws_s3")->label(t("Amazon S3 Settings"));
$group->checkbox("enabled")->id("s3-enabled")->checked(module::get_var("aws_s3", "enabled"))->label("S3 enabled");
$group->input("access_key")->id("s3-access-key")->label("Access Key ID")->value(module::get_var("aws_s3", "access_key"))->rules("required")->error_messages("required", "This field is required")->message('<a target="_blank" href="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key">Sign up to Amazon S3</a>');
$group->input("secret_key")->id("s3-secret-key")->label("Secret Access Key")->value(module::get_var("aws_s3", "secret_key"))->rules("required")->error_messages("required", "This field is required");
$group->input("bucket_name")->id("s3-bucket")->label("Bucket Name")->value(module::get_var("aws_s3", "bucket_name"))->rules("required")->error_messages("required", "This field is required")->message("Note: This module will not create a bucket if it does not already exist. Please ensure you have already created the bucket and the bucket has the correct ACL permissions before continuing.");
$group->input("g3id")->id("s3-g3id")->label("G3 ID")->value(module::get_var("aws_s3", "g3id", md5(time())))->rules("required")->error_messages("required", "This field is required")->message("This field allows for multiple G3 instances running off of a single S3 bucket.");
$group->checkbox("use_ssl")->id("s3-use-ssl")->checked(module::get_var("aws_s3", "use_ssl"))->label("Use SSL for S3 transfers");
$group = $form->group("cdn_settings")->label(t("CDN Settings"));
$group->input("url_str")->id("s3-url-str")->label("URL String")->value(module::get_var("aws_s3", "url_str", "http://{bucket}.s3.amazonaws.com/g3/{guid}/{resource}"))->rules("required")->message("Configure the URL to access uploaded resources on the CDN. Use the following variables to define and build up the URL:<br />\n• {bucket} - Bucket Name<br />\n• {guid} - Unique identifier for this gallery installation<br />\n• {resource} - The end path to the resource/object");
$group->input("sig_exp")->id("sig_exp")->label("Private Content Signature Duration")->value(module::get_var("aws_s3", "sig_exp", 60))->rules("required")->callback("aws_s3::validate_number")->error_messages("not_numeric", "The value provided is not numeric. Please enter a number in this field.")->message("Set the time in seconds for the generated signature for access to permission-restricted S3 objects<br /><br />\nNote: this module does not yet support the creation of signatures to access private objects on S3 via CloudFront CDN.");
$form->submit("save")->value("Save Settings");
return $form;
}
示例13: Forge
static function get_delete_form_admin($postage)
{
$form = new Forge("admin/postage_bands/delete_postage_band/{$postage->id}", "", "post", array("id" => "gDeletePostageForm"));
$group = $form->group("delete_postage")->label(t("Are you sure you want to delete postage band %name?", array("name" => $postage->name)));
$group->submit("")->value(t("Delete postage band %name", array("name" => $postage->name)));
return $form;
}
示例14: Block
static function sidebar_blocks($theme)
{
// Display form for tagging in the album sidebar.
// Make sure the current page belongs to an item.
if (!$theme->item()) {
return;
}
$item = $theme->item();
// Only display the form in albums that the user has edit permission in.
if ($item->is_album() && access::can("edit", $item)) {
// Make a new sidebar block.
$block = new Block();
$block->css_id = "gBatchTag";
$block->title = t("Batch Tag");
$block->content = new View("batchtag_block.html");
// Make a new form to place in the sidebar block.
$form = new Forge("batchtag/tagitems", "", "post", array("id" => "gBatchTagForm"));
$label = t("Tag everything in this album:");
$group = $form->group("add_tag")->label("Add Tag");
$group->input("name")->label($label)->rules("required|length[1,64]");
$group->hidden("item_id")->value($item->id);
$group->submit("")->value(t("Add Tag"));
$block->content->form = $form;
// Display the block.
return $block;
}
}
示例15: get
static function get($block_id, $theme)
{
$block = "";
// Only display on album pages that the user can edit.
$item = $theme->item();
if (!$item || !$item->is_album() || !access::can("edit", $item)) {
return;
}
switch ($block_id) {
case "batch_tag":
// Make a new sidebar block.
$block = new Block();
$block->css_id = "g-batch-tag";
$block->title = t("Batch Tag");
$block->content = new View("batchtag_block.html");
// Make a new form to place in the sidebar block.
$form = new Forge("batchtag/tagitems", "", "post", array("id" => "g-batch-tag-form"));
$label = t("Tag everything in this album:");
$group = $form->group("add_tag")->label("Add Tag");
$group->input("name")->label($label)->rules("required|length[1,64]");
$group->checkbox("tag_subitems")->label(t("Include sub-albums?"))->value(true)->checked(false);
$group->hidden("item_id")->value($item->id);
$group->submit("")->value(t("Add Tag"));
$block->content->batch_tag_form = $form;
break;
}
return $block;
}