当前位置: 首页>>代码示例>>PHP>>正文


PHP FORM::value_for方法代码示例

本文整理汇总了PHP中FORM::value_for方法的典型用法代码示例。如果您正苦于以下问题:PHP FORM::value_for方法的具体用法?PHP FORM::value_for怎么用?PHP FORM::value_for使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FORM的用法示例。


在下文中一共展示了FORM::value_for方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _draw_folder_selector

 /**
  * @param FORM $form
  * @param FORM_RENDERER $renderer
  * @access private
  */
 protected function _draw_folder_selector($form, $renderer)
 {
     $props = $renderer->make_list_properties();
     $props->add_item('Context or none', Search_user_context_none);
     $props->add_item('Selected folder(s)', Search_user_constant);
     $props->add_item('NOT selected folder(s)', Search_user_not_constant);
     /** @var $id_values int[] */
     $id_values = $form->value_for('folder_ids');
     $selected_folder_ids = array();
     if (sizeof($id_values)) {
         foreach ($id_values as $id) {
             if ($id) {
                 $selected_folder_ids[$id] = $id;
             }
         }
     }
     $visible = $form->value_for('folder_search_type') != Search_user_context_none || sizeof($selected_folder_ids) > 0;
     $layer = $renderer->start_layer_row('folders', 'Folder(s)', 'Toggle folder options.', $visible);
     $renderer->start_row(' ');
     echo $renderer->drop_down_as_html('folder_search_type', $props);
     echo ' ';
     $renderer->finish_row();
     $renderer->start_row(' ');
     $folder_query = $this->login->folder_query();
     $folder_query->clear_results();
     $folders = $folder_query->root_tree($this->app->root_folder_id);
     $selected_folders = $folder_query->objects_at_ids($selected_folder_ids);
     /* Make a copy (not a reference). */
     $tree = $this->app->make_tree_renderer();
     include_once 'webcore/gui/folder_tree_node_info.php';
     $tree_node_info = new FOLDER_TREE_NODE_INFO($this->app);
     include_once 'webcore/gui/selector_tree_decorator.php';
     $decorator = new MULTI_SELECTOR_TREE_DECORATOR($tree, $selected_folder_ids);
     $decorator->control_name = 'folder_ids';
     $decorator->form_name = $form->name;
     $decorator->auto_toggle_children = true;
     $tree->node_info = $tree_node_info;
     $tree->decorator = $decorator;
     $tree->set_visible_nodes($selected_folders);
     $tree->display($folders);
     $renderer->finish_row();
     $renderer->finish_layer_row($layer);
 }
开发者ID:mvonballmo,项目名称:earthli-webcore,代码行数:48,代码来源:search_fields.php


注:本文中的FORM::value_for方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。