示例#1
0
 public function outputAttrs()
 {
     $out = parent::outputAttrs();
     $out['columns'] = $this->columns;
     //print_r($out['columns']);
     return $out;
 }
示例#2
0
 /**
  * Render smarty template for view object
  *
  * @param EasyView $viewObj
  * @param string $tplFile
  * @return string result of rendering process
  */
 protected static function renderSmarty($viewObj, $tplFile)
 {
     $smarty = BizSystem::getSmartyTemplate();
     $newClntObjs = '';
     // render the viewobj attributes
     $smarty->assign("view", $viewObj->outputAttrs());
     $smarty->assign("module", $viewObj->getModuleName($viewObj->m_Name));
     if ($viewObj->m_Tiles) {
         foreach ($viewObj->m_Tiles as $tname => $tile) {
             foreach ($tile as $formRef) {
                 if ($formRef->m_Display == false) {
                     continue;
                 }
                 $tiles[$tname][$formRef->m_Name] = BizSystem::getObject($formRef->m_Name)->render();
                 $tiletabs[$tname][$formRef->m_Name] = $formRef->m_Description;
             }
         }
     } else {
         foreach ($viewObj->m_FormRefs as $formRef) {
             if ($formRef->m_Display == false) {
                 continue;
             }
             $forms[$formRef->m_Name] = BizSystem::getObject($formRef->m_Name)->render();
             $formtabs[$formRef->m_Name] = $formRef->m_Description;
         }
     }
     // add clientProxy scripts
     $includedScripts = BizSystem::clientProxy()->getAppendedScripts();
     $styles = BizSystem::clientProxy()->getAppendedStyles();
     if ($viewObj->m_IsPopup && $bReRender == false) {
         $moveToCenter = "moveToCenter(self, " . $viewObj->m_Width . ", " . $viewObj->m_Height . ");";
         $scripts = $includedScripts . "\n<script>\n" . $newClntObjs . $moveToCenter . "</script>\n";
     } else {
         $scripts = $includedScripts . "\n<script>\n" . $newClntObjs . "</script>\n";
     }
     if ($viewObj->m_Title) {
         $title = Expression::evaluateExpression($viewObj->m_Title, $viewObj);
     } else {
         $title = $viewObj->m_Description;
     }
     $smarty->assign("scripts", $scripts);
     $smarty->assign("style_sheets", $styles);
     $smarty->assign("title", $title);
     $smarty->assign("description", $viewObj->m_Description);
     $smarty->assign("keywords", $viewObj->m_Keywords);
     $smarty->assign("forms", $forms);
     $smarty->assign("formtabs", $formtabs);
     $smarty->assign("tiles", $tiles);
     $smarty->assign("tiletabs", $tiletabs);
     if ($viewObj->m_ConsoleOutput) {
         $smarty->display(BizSystem::getTplFileWithPath($viewObj->m_TemplateFile, $viewObj->m_Package));
     } else {
         return $smarty->fetch(BizSystem::getTplFileWithPath($viewObj->m_TemplateFile, $viewObj->m_Package));
     }
 }
示例#3
0
 /**
  * Get output attributs
  *
  * @return array
  * @todo need to raname to getOutputAttributs() or getAttributes
  */
 public function outputAttrs()
 {
     $out = parent::outputAttrs();
     $out['step'] = $this->m_CurrentStep;
     $out['forms'] = $this->m_FormRefs;
     return $out;
 }
示例#4
0
 /**
  * Gather all template variables needed. Should play well with Smarty or Zend templates
  *
  * @param EasyView $formObj
  * @return array associative array holding all needed VIEW based template variables
  */
 public static function buildTemplateAttributes($formObj)
 {
     // Assocative Array to hold all Template Values
     // Fill with default viewobj attributes
     $tplAttributes = array();
     $tplAttributes['title'] = $formObj->m_Title;
     $tplAttributes['errors'] = $formObj->m_Errors;
     $tplAttributes['notices'] = $formObj->m_Notices;
     $tplAttributes['formname'] = $formObj->m_Name;
     $tplAttributes['module'] = $formObj->getModuleName($formObj->m_Name);
     // if the $formobj form type is list render table, otherwise render record
     if (strtoupper($formObj->m_FormType) == 'LIST') {
         $tplAttributes['dataPanel'] = $formObj->m_DataPanel->render();
     } else {
         $tplAttributes['dataPanel'] = $formObj->m_DataPanel->render();
     }
     if (isset($formObj->m_SearchPanel)) {
         $search_record = $formObj->m_SearchPanelValues;
         foreach ($formObj->m_SearchPanel as $elem) {
             if (!$elem->m_FieldName) {
                 continue;
             }
             $post_value = BizSystem::clientProxy()->getFormInputs($elem->m_Name);
             if ($post_value) {
                 $search_record[$elem->m_FieldName] = $post_value;
             }
         }
         $tplAttributes['searchPanel'] = $formObj->m_SearchPanel->renderRecord($search_record);
     } else {
         $tplAttributes['searchPanel'] = $formObj->m_SearchPanel->render();
     }
     $tplAttributes['actionPanel'] = $formObj->m_ActionPanel->render();
     $tplAttributes['navPanel'] = $formObj->m_NavPanel->render();
     if ($formObj->m_WizardPanel) {
         $tplAttributes['wizardPanel'] = $formObj->m_WizardPanel->render();
     }
     $tplAttributes['form'] = $formObj->outputAttrs();
     $outputAttrs = $formObj->outputAttrs();
     foreach ($outputAttrs as $k => $v) {
         $tplAttributes[$k] = $v;
     }
     return $tplAttributes;
 }
示例#5
0
 /**
  * Render smarty template for view object
  *
  * @param EasyView $viewObj
  * @param string $tplFile
  * @return string result of rendering process
  */
 protected static function renderSmarty($viewObj, $tplAttributes = array())
 {
     $smarty = BizSystem::getSmartyTemplate();
     $viewOutput = $viewObj->outputAttrs();
     foreach ($viewOutput as $k => $v) {
         $smarty->assign($k, $v);
     }
     // render the formobj attributes
     $smarty->assign("view", $viewOutput);
     //Translate Array of template variables to Zend template object
     foreach ($tplAttributes as $key => $value) {
         $smarty->assign($key, $value);
     }
     $tpl = $_REQUEST['partial'] ? $viewObj->m_TemplateFile : $viewObj->m_PageTemplate;
     if ($viewObj->m_ConsoleOutput) {
         $smarty->display(BizSystem::getTplFileWithPath($tpl, $viewObj->m_Package));
     } else {
         return $smarty->fetch(BizSystem::getTplFileWithPath($tpl, $viewObj->m_Package));
     }
 }