Exemplo n.º 1
0
 function build($prefix_name = "params", $arr_size = array(5, 7))
 {
     $name = $prefix_name . "[" . $this->node['name'] . "]";
     $id = $prefix_name . "-" . $this->node['name'] . "-";
     if (strpos($this->node['attr'], "multiple")) {
         $name = $name . "[]";
     }
     $obj_module = YiiCategory::getInstance();
     $items = $obj_module->loadItems('id value, title text');
     $html = buildHtml::select($items, $this->value, "{$name}", "{$id}", $this->node['attr']);
     return '<div class="form-group row"> <div class="col-md-' . $arr_size[0] . '" title="' . $this->node['description'] . '">' . $this->node['label'] . '</div> ' . '<div class="col-md-' . $arr_size[1] . '">' . $html . '</div> ' . " </div>";
 }
Exemplo n.º 2
0
 function changeFeature($cid, $value)
 {
     global $mainframe, $user;
     if (!$user->isSuperAdmin()) {
         YiiMessage::raseNotice("Your account not have permission to modify category");
         $this->redirect(Router::buildLink("categories"));
     }
     $obj = YiiCategory::getInstance();
     $obj = $obj->loadItem($cid, "*", false);
     $obj->feature = $value;
     $obj->store();
 }
Exemplo n.º 3
0
 function getListEdit($mainitem)
 {
     $obj_category = YiiCategory::getInstance();
     $lists = array();
     $items = $obj_category->getScope();
     $lists['scopes'] = buildHtml::select($items, $mainitem->scope, "scope", "scope");
     return $lists;
 }
Exemplo n.º 4
0
 public function getListEdit($mainItem)
 {
     $list = array();
     $obj_module = YiiCategory::getInstance();
     $items = $obj_module->loadItems('id value, name text', "scope = 'videos'");
     $list['category'] = buildHtml::select($items, $mainItem->catID, "catID", "", "size=7");
     $items = array();
     $items[] = array("value" => 0, "text" => "Unpublish");
     $items[] = array("value" => 1, "text" => "Publish");
     $items[] = array("value" => -1, "text" => "Hidden");
     $list['status'] = buildHtml::select($items, $mainItem->status, "status");
     $items = array();
     $items[] = array("value" => 0, "text" => "Disable");
     $items[] = array("value" => 1, "text" => "Enable");
     $list['feature'] = buildHtml::select($items, $mainItem->feature, "feature");
     return $list;
 }