[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6938] UI class to display bim items
From: |
Petur Thorsteinsson |
Subject: |
[Fmsystem-commits] [6938] UI class to display bim items |
Date: |
Sun, 06 Feb 2011 20:55:39 +0000 |
Revision: 6938
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6938
Author: peturbjorn
Date: 2011-02-06 20:55:37 +0000 (Sun, 06 Feb 2011)
Log Message:
-----------
UI class to display bim items
Added Paths:
-----------
branches/dev-bim2/property/inc/class.uibimitem.inc.php
Added: branches/dev-bim2/property/inc/class.uibimitem.inc.php
===================================================================
--- branches/dev-bim2/property/inc/class.uibimitem.inc.php
(rev 0)
+++ branches/dev-bim2/property/inc/class.uibimitem.inc.php 2011-02-06
20:55:37 UTC (rev 6938)
@@ -0,0 +1,113 @@
+<?php
+phpgw::import_class('phpgwapi.yui');
+phpgw::import_class('property.bobimitem');
+phpgw::import_class('property.sobimitem');
+/*
+ * This class serves as the 'Controller' or 'Container' in a dependancy
injection context
+ */
+interface uibimitem {
+ public function showItems();
+ public function showBimItem();
+}
+class property_uibimitem implements uibimitem {
+ private $db;
+
+ public function __construct() {
+ $this->bocommon = CreateObject('property.bocommon');
+
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+ $this->db = & $GLOBALS['phpgw']->db;
+ }
+
+ public $public_functions = array
+ (
+ 'showItems' => true,
+ 'showBimItem' => true
+ );
+
+ public function showItems() {
+ $GLOBALS['phpgw']->js->validate_file( 'yahoo', 'bim.modellist',
'property' );
+ $modelId = phpgw::get_var("modelId");
+ //$modelId = 3;
+ if(empty($modelId)) {
+ echo "No modelId!";
+ } else {
+
$GLOBALS['phpgw']->xslttpl->add_file(array('bim_showitems'));
+ $sobimitem = new sobimitem_impl($this->db);
+ $sobimitem->setModelId($modelId);
+ $bobimitem = new bobimitem_impl();
+ $bobimitem->setSobimitem($sobimitem);
+ $items = $bobimitem->fetchItemsByModelId();
+ $bimItems = array();
+ $count = count(($items));
+ foreach( $items as $bimItem) {
+ /* @var $bimItem BimItem*/
+ array_push($bimItems,
$bimItem->transformObjectToArray());//$bimItem->);
+ }
+ //$bimItems = print_r($items, true);
+
+ $data = array(
+ 'someData' => "data",
+ 'modelId' => $modelId,
+ 'count' => $count,
+ 'bimItems' => array("item" => $bimItems)
+ );
+
+
+ $this->setupBimCss();
+ $GLOBALS['phpgw']->xslttpl->set_var('bimitems',$data);
+ }
+
+ }
+ public function showBimItem() {
+ /*$GLOBALS['phpgw_info']['flags']['noheader'] = false;
+ $GLOBALS['phpgw_info']['flags']['nofooter'] = false;
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+ $GLOBALS['phpgw']->common->phpgw_header(true);*/
+
+ $GLOBALS['phpgw']->js->validate_file( 'yahoo', 'bim.modellist',
'property' );
+ $modelGuid = phpgw::get_var("modelGuid");
+ //$modelId = 3;
+ if(empty($modelGuid)) {
+ echo "No guid!";
+ } else {
+
$GLOBALS['phpgw']->xslttpl->add_file(array('bim_showSingleItem'));
+ $sobimitem = new sobimitem_impl($this->db);
+ /* @var $bimItem BimItem */
+ $bimItem = $sobimitem->getBimItem($modelGuid);
+ $data = array(
+ 'item' => $bimItem->transformObjectToArray(),
+ 'dir' => PHPGW_TEMPLATE_DIR
+ );
+ //$GLOBALS['phpgw']->xslttpl->set_var('bimitem',$data);
+
+ $GLOBALS['phpgw']->xslttpl->set_xml_data($bimItem->getXml());
+ $this->setupBimCss();
+ }
+ }
+
+ private function testTemplate() {
+ phpgw::import_class('phpgwapi.template_portico');
+ $app = $GLOBALS['phpgw_info']['flags']['currentapp'];
+
+
$GLOBALS['phpgw']->template->set_root("C:\\vBoxShare\\html\\dev-bim2\\property\\templates\\portico");
+ $GLOBALS['phpgw']->template->set_unknowns('remove');
+ $GLOBALS['phpgw']->template->set_file('test', 'test.tpl');
+ $tpl_vars = array
+ (
+ 'test2' => "myTest"
+ );
+
+ $GLOBALS['phpgw']->template->set_var($tpl_vars);
+ $GLOBALS['phpgw']->template->pfp('out', 'test');
+ unset($tpl_vars);
+ }
+ private function setupBimCss() {
+ if ( !isset($GLOBALS['phpgw']->css) || !is_object($GLOBALS['phpgw']->css)
) {
+ $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
+ }
+
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/bim.css');
+ }
+
+
+}
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6938] UI class to display bim items,
Petur Thorsteinsson <=