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


PHP storage::get_count_per_type方法代码示例

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


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

示例1: select

 function select()
 {
     // set ENV
     $deployment = new deployment();
     $storage = new storage();
     $resource = new resource();
     $deployment->get_instance_by_type("linuxcoe-deployment");
     $table = $this->response->html->tablebuilder('linuxcoe_select', $this->response->get_array($this->actions_name, 'select'));
     $table->sort = 'storage_id';
     $table->limit = 10;
     $table->offset = 0;
     $table->order = 'ASC';
     $table->max = $storage->get_count_per_type($deployment->id);
     $table->autosort = false;
     $table->sort_link = false;
     $table->init();
     $storages = $storage->display_overview_per_type($deployment->id, $table->offset, $table->limit, $table->sort, $table->order);
     if (count($storages) >= 1) {
         foreach ($storages as $k => $v) {
             $storage->get_instance_by_id($v["storage_id"]);
             $resource->get_instance_by_id($storage->resource_id);
             $deployment->get_instance_by_id($storage->type);
             $resource_icon_default = "/img/resource.png";
             $storage_icon = "/plugins/linuxcoe/img/plugin.png";
             $state_icon = $this->openqrm->get('baseurl') . "/img/" . $resource->state . ".png";
             if ($this->file->exists($this->openqrm->get('webdir') . $storage_icon)) {
                 $resource_icon_default = $storage_icon;
             }
             $resource_icon_default = $this->openqrm->get('baseurl') . $resource_icon_default;
             $a = $this->response->html->a();
             $a->title = $this->lang['action_edit'];
             $a->label = $this->lang['action_edit'];
             $a->handler = 'onclick="wait();"';
             $a->css = 'edit';
             $a->href = $this->response->get_url($this->actions_name, "edit") . '&storage_id=' . $storage->id;
             $data = '<b>' . $this->lang['table_recource'] . ':</b> ' . $resource->id . ' / ' . $resource->ip . '<br>';
             $data .= '<b>' . $this->lang['table_type'] . ':</b> ' . $deployment->type . '<br>';
             $data .= '<b>' . $this->lang['table_deployment'] . ':</b> ' . $deployment->storagedescription . '<br>';
             $b[] = array('state' => '<img width="24" height="24" src="' . $state_icon . '" alt="State">', 'icon' => '<img width="24" height="24" src="' . $resource_icon_default . '" alt="Icon">', 'storage_id' => $storage->id, 'storage_name' => $storage->name, 'storage_resource_id' => $storage->resource_id, 'storage_data' => $data, 'storage_comment' => '', 'storage_edit' => $a->get_string());
         }
         $h = array();
         $h['state'] = array();
         $h['state']['title'] = '&#160;';
         $h['state']['sortable'] = false;
         $h['icon'] = array();
         $h['icon']['title'] = '&#160;';
         $h['icon']['sortable'] = false;
         $h['storage_id'] = array();
         $h['storage_id']['title'] = $this->lang['table_id'];
         $h['storage_name'] = array();
         $h['storage_name']['title'] = $this->lang['table_name'];
         $h['storage_resource_id'] = array();
         $h['storage_resource_id']['title'] = $this->lang['table_recource'];
         $h['storage_resource_id']['hidden'] = true;
         $h['storage_data'] = array();
         $h['storage_data']['title'] = '&#160;';
         $h['storage_data']['sortable'] = false;
         $h['storage_comment'] = array();
         $h['storage_comment']['title'] = '&#160;';
         $h['storage_comment']['sortable'] = false;
         $h['storage_edit'] = array();
         $h['storage_edit']['title'] = '&#160;';
         $h['storage_edit']['sortable'] = false;
         $table->id = 'Tabelle';
         $table->css = 'htmlobject_table';
         $table->border = 1;
         $table->cellspacing = 0;
         $table->cellpadding = 3;
         $table->form_action = $this->response->html->thisfile;
         $table->head = $h;
         $table->body = $b;
         $table->limit_select = array(array("value" => 10, "text" => 10), array("value" => 20, "text" => 20), array("value" => 30, "text" => 30), array("value" => 40, "text" => 40), array("value" => 50, "text" => 50));
         return $table->get_string();
     } else {
         $a = $this->response->html->a();
         $a->title = $this->lang['new_storage'];
         $a->label = $this->lang['new_storage'];
         $a->handler = 'onclick="wait();"';
         $a->css = 'add';
         $a->href = $this->response->html->thisfile . '?base=storage&storage_action=add';
         $box = $this->response->html->div();
         $box->id = 'Tabelle';
         $box->css = 'htmlobject_box';
         $content = $this->lang['error_no_storage'] . '<br><br>';
         $content .= $a->get_string();
         $box->add($content);
         return $box->get_string();
     }
 }
开发者ID:kelubo,项目名称:OpenQRM,代码行数:89,代码来源:linuxcoe.select.class.php


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