diff --git a/Conjuro/Conjuro.php b/Conjuro/Conjuro.php index 637dd56..5ebaaaf 100644 --- a/Conjuro/Conjuro.php +++ b/Conjuro/Conjuro.php @@ -40,7 +40,16 @@ ///////////////////////////////////////////////////// DATABASE TOOLS //////////////////////////////////////////////////////////////////// - // Return data from database + /** + * Select a list from te database + */ + public function DBlist($type,$fields=null,$where='',$types = null,&...$data){ + return $this->db()->select($type,$fialds,$where,$types,...$data); + } + + /** + * Return single entity from DB + */ public function DBget($type,$key=""){ if ($key!="") $data=$this->db()->select($type,null,'where id=?','i',$key); @@ -227,14 +236,6 @@ } /** - * Load control libraries installed - */ - /*public function loadControls(){ - // TODO- glob directoty to fetch all libraries. - $this->loadControlLibrary("common"); - }*/ - - /** * Return a control */ public function control($name){ diff --git a/content/controls/common-admin.php b/content/controls/common-admin.php index 2e0e566..c6c1e7d 100644 --- a/content/controls/common-admin.php +++ b/content/controls/common-admin.php @@ -5,7 +5,12 @@ return [ new class("admin-title") extends Control{ protected function renderControl($meta,$data) { - echo $meta["title"]; + c()->rhtml('div',['class'=>'admin-title'],function() use($meta){ + echo $meta["title"]; + }); + c()->rhtml('div',['class'=>'admin-title-right'],function() use($meta){ + c()->control("icon")->render(['icon'=>'gear','class'=>'btn-ico'],$data); + }); } }, new class("admin-panel-buttons") extends Control{ @@ -22,6 +27,18 @@ echo ''.$meta["title"].''; echo ''; } - } + }, + new class("admin-tile") extends Control{ + protected function renderControl($meta,$data) { + ?> +
+ \ No newline at end of file diff --git a/content/controls/common.php b/content/controls/common.php index 00f04b3..69595d7 100644 --- a/content/controls/common.php +++ b/content/controls/common.php @@ -33,7 +33,7 @@ function() use($meta,$data,$cols){ echo '