Example #1
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));
     }
 }
Example #2
0
 public function outputAttrs()
 {
     $out = parent::outputAttrs();
     $out['columns'] = $this->columns;
     //print_r($out['columns']);
     return $out;
 }
Example #3
0
 protected function readMetaData($xmlArr)
 {
     parent::readMetaData($xmlArr);
     unset($this->m_FormRefs);
     $this->m_FormSelector = isset($xmlArr["EASYVIEW"]["ATTRIBUTES"]["FROMSELECOTR"]) ? $xmlArr["EASYVIEW"]["ATTRIBUTES"]["FROMSELECOTR"] : null;
     $formRefXML = $this->getDefaultMainForm($xmlArr["EASYVIEW"]["FORMREFERENCES"]["REFERENCE"]);
     $this->m_FormRefs = new MetaIterator($formRefXML, "FormReference", $this);
 }
Example #4
0
 public function allowAccess($access = null)
 {
     if ($this->isNeedInitialize()) {
         BizSystem::sessionContext()->setVar("_GROUP_INITIALIZE_LASTVIEW", $_SERVER['REQUEST_URI']);
         BizSystem::clientProxy()->redirectPage(APP_INDEX . '/system/initialize_group');
     }
     return parent::allowAccess($access);
 }
 public function render()
 {
     if (!extension_loaded('ionCube Loader')) {
         $result = parent::render();
         return $result;
     } else {
         header("Location: " . APP_INDEX);
         exit;
     }
 }
Example #6
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;
 }
 public function allowAccess()
 {
     $result = parent::allowAccess();
     $do = BizSystem::getObject("myaccount.do.PreferenceDO");
     $rs = $do->fetchOne("[user_id]='0' AND  [section]='Register' AND [name]='find_password'");
     $value = $rs->value;
     if ($value == 0 || $value == null) {
         return 0;
     } else {
         return $result;
     }
 }
Example #8
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;
 }
Example #9
0
 /**
  * Initialize DynaView with xml array
  *
  * @param array $xmlArr
  * @return void
  */
 public function __construct(&$xmlArr)
 {
     parent::__construct($xmlArr);
     $this->processURL();
 }
Example #10
0
 /**
  * Ask if the $this tab object is the current tab
  *
  * @param TabView $tabView
  * @param EasyView $curViewObj current View Object
  * @param string $curViewName name of the current view
  * @return boolean TRUE if on the current tab, otherwise FALSE
  */
 public function isCurrentTab($tabView, $curViewObj, $curViewName)
 {
     //--jmmz
     $currentTab = false;
     //this variable save 'true' if is the current tab and 'false' in otherwise --jmmz
     if ($this->m_CurrentTab) {
         $currentTab = $this->m_CurrentTab == $tabView->m_Name || $this->m_CurrentTab == $tabView->m_Tab ? TRUE : FALSE;
     } elseif ($tabView->m_ViewSet) {
         if ($curViewObj) {
             // check if current view's viewset == tview->m_ViewSet
             $currentTab = $curViewObj->getViewSet() == $tabView->m_ViewSet ? true : false;
         }
     } else {
         $currentTab = $curViewName == $tabView->m_View || $curViewObj->m_Tab == $tabView->m_Name ? true : false;
     }
     return $currentTab;
 }
Example #11
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));
     }
 }