/**
     * @Clips\Widgets\DataTable("admin_resource")
     * @Clips\Actions("admin/resource")
     */
    public function index()
    {
        $data = $this->resource->getResourceTypes();
        \Clips\add_init_js(<<<T_EXTENDS
function datatable_render_resource_name(data, type, full, meta) {
\tvar json = JSON.parse(data);
\tconsole.info(json);
\tvar ul = [];
\tvar i = 0;
\tfor(i = 0; i < json.length; i++) {
\t\tul.push('<br />'+'<li style="list-style-type:none"><img src="'+Clips.staticUrl('application/static/img/' + json[i]['path'])+'" width=100 height=100></li>');
\t\tul.push();
\t}
\treturn "<ul>" + ul.join("") + "</ul>";
}
function datatable_render_resource_type(data, type, full, meta) {
\t\tconsole.info(data);
\t\tif(data==1)
\t\t\treturn   "<h1>资料下载</h1>";

}
T_EXTENDS
);
        if ($this->permission()) {
            $a = new SimpleAction(array('children' => $this->data->navi));
            return $this->render('admin/resource/index', array('actions' => $a->children()));
        } else {
            return $this->render('admin/error');
        }
    }
Esempio n. 2
0
 /**
  * @Clips\TestValue(json="tree.json")
  */
 public function testSimpleAction()
 {
     $action = new Action($this->value);
     $this->assertEquals($action->label(), 'root');
 }
Esempio n. 3
0
 public function __construct($data = array())
 {
     parent::__construct($data);
 }