CSmartyDP PHP Class Code Examples

This page contains top rated real world PHP examples of class CSmartyDP extracted from open source projects. You can rate examples to help us improve the quality of examples

Example #1
Show file File: CCdaTools.class.php Project: fbone/mediboard4
0
 /**
  * fonction permettant de créér la structure principal des classes d'un XSD
  *
  * @return bool
  */
 static function createClassFromXSD()
 {
     $pathXSD = "modules/cda/resources/POCD_MT000040.xsd";
     $pathDir = "modules/cda/classes/classesCDA/classesGenerate/";
     $dom = new CMbXMLDocument("UTF-8");
     $dom->load($pathXSD);
     $xpath = new CMbXPath($dom);
     $xpath->registerNamespace("xs", "http://www.w3.org/2001/XMLSchema");
     $nodeList = $xpath->query("//xs:complexType[@name] | //xs:simpleType[@name]");
     foreach ($nodeList as $_node) {
         $tabVariable = array();
         $tabProps = array();
         /** @var DOMElement $_node */
         $elements = $_node->getElementsByTagName("element");
         $nodeAttributes = $_node->getElementsByTagName("attribute");
         $nameNode = $xpath->queryAttributNode(".", $_node, "name");
         $nameNode = str_replace(".", "_", $nameNode);
         list($tabVariable, $tabProps) = self::createPropsForElement($elements, $tabVariable, $tabProps);
         list($tabVariable, $tabProps) = self::createPropsForElement($nodeAttributes, $tabVariable, $tabProps);
         $smarty = new CSmartyDP();
         $smarty->assign("name", $nameNode);
         $smarty->assign("variables", $tabVariable);
         $smarty->assign("props", $tabProps);
         $data = $smarty->fetch("defaultClassCDA.tpl");
         file_put_contents($pathDir . "CCDA" . $nameNode . ".class.php", $data);
     }
     return true;
 }
Example #2
Show file File: CTemplateManager.class.php Project: fbone/mediboard4
0
 /**
  * Affiche l'éditeur de texte avec le contenu du document
  *
  * @return void
  */
 function initHTMLArea()
 {
     // Don't use CValue::setSession which uses $m
     $_SESSION["dPcompteRendu"]["templateManager"] = gzcompress(serialize($this));
     $smarty = new CSmartyDP("modules/dPcompteRendu");
     $smarty->assign("templateManager", $this);
     $smarty->display("init_htmlarea.tpl");
 }
Example #3
Show file File: CModule.class.php Project: fbone/mediboard4
0
 /**
  * Checks if the module is active
  *
  * @return bool
  */
 function checkActive()
 {
     if (!$this->mod_active) {
         $smarty = new CSmartyDP("modules/system");
         $smarty->display("module_inactive.tpl");
         return false;
     }
     return true;
 }
Example #4
Show file File: CCompteRendu.class.php Project: fbone/mediboard4
0
 /**
  * Construit une source html
  *
  * @param string $htmlcontent html source to use if not a model
  * @param string $mode        [optional]
  * @param array  $margins     [optional]
  * @param string $font        Font name
  * @param string $size        Font size
  * @param string $auto_print  [optional]
  * @param string $type        [optional]
  * @param string $header      [optional]
  * @param int    $sizeheader  [optional]
  * @param string $footer      [optional]
  * @param int    $sizefooter  [optional]
  * @param string $preface     [optional]
  * @param string $ending      [optional]
  *
  * @return string
  */
 function loadHTMLcontent($htmlcontent, $mode = "modele", $margins = array(), $font = "", $size = "", $auto_print = true, $type = "body", $header = "", $sizeheader = 0, $footer = "", $sizefooter = 0, $preface = "", $ending = "")
 {
     $default_font = $font;
     $default_size = $size;
     if ($default_font == "") {
         $default_font = CAppUI::conf("dPcompteRendu CCompteRendu default_font");
     }
     if ($default_size == "") {
         $default_size = CAppUI::conf("dPcompteRendu CCompteRendu default_size");
     }
     $style = file_get_contents("style/mediboard/htmlarea.css") . "@page {\n         margin-top:    {$margins[0]}cm;\n         margin-right:  {$margins[1]}cm;\n         margin-bottom: {$margins[2]}cm;\n         margin-left:   {$margins[3]}cm;\n       }\n       body, table {\n         font-family: {$default_font};\n         font-size: {$default_size};\n       }\n       body {\n         margin:  0;\n         padding: 0;\n       }\n       .orig {\n         display: none;\n       }";
     $content = "";
     $position = array("header" => "top", "footer" => "bottom");
     if ($mode == "modele") {
         switch ($type) {
             case "header":
             case "footer":
                 $position = $position[$type];
                 $sizeheader = $sizeheader != '' ? $sizeheader : 50;
                 $style .= "\n            #{$type} {\n              height: {$sizeheader}px;\n              {$position}: 0cm;\n              width: auto;\n            }";
                 $content = "<div id=\"{$type}\">{$htmlcontent}</div>";
                 break;
             case "body":
             case "preface":
             case "ending":
                 if ($header) {
                     $sizeheader = $sizeheader != '' ? $sizeheader : 50;
                     $padding_top = $sizeheader;
                     $style .= "\n                @media print {\n                  body { \n                    margin-top: {$padding_top}px;\n                  }\n                  #header {\n                    height: {$sizeheader}px;\n                    top: 0cm;\n                  }\n                }";
                     $content .= "<div id=\"header\">{$header}</div>";
                 }
                 if ($footer) {
                     $sizefooter = $sizefooter != '' ? $sizefooter : 50;
                     $padding_bottom = $sizefooter;
                     $style .= "\n                @media print {\n                  body { \n                    margin-bottom: {$padding_bottom}px;\n                  }\n                  #footer {\n                    height: {$sizefooter}px;\n                    bottom: 0cm;\n                  }\n                }";
                     $content .= "<div id=\"footer\">{$footer}</div>";
                 }
                 if ($preface) {
                     $htmlcontent = "{$preface}<br />" . $htmlcontent;
                 }
                 if ($ending) {
                     $htmlcontent .= "<br />{$ending}";
                 }
                 $content .= "<div id=\"body\">{$htmlcontent}</div>";
         }
     } else {
         $content = $htmlcontent;
     }
     $smarty = new CSmartyDP();
     $smarty->assign("style", $style);
     $smarty->assign("content", $content);
     $smarty->assign("auto_print", $auto_print);
     return $smarty->fetch("../../dPcompteRendu/templates/htmlheader.tpl");
 }
Example #5
Show file File: CBrisDeGlace.class.php Project: fbone/mediboard4
0
 /**
  * check if the sejour need to be unlock
  *
  * @param CSejour $sejour
  *
  * @return bool
  */
 static function checkForSejour($sejour, $modal = true)
 {
     if (!self::canAccess($sejour)) {
         $smarty = new CSmartyDP("modules/admin");
         $smarty->assign("sejour", $sejour);
         $smarty->assign("bris", new CBrisDeGlace());
         $smarty->assign("modale", $modal);
         $smarty->display("need_bris_de_glace.tpl");
         CApp::rip();
     }
     return true;
 }
Example #6
Show file File: CFichePaie.class.php Project: fbone/mediboard4
0
 /**
  * @see parent::store()
  */
 function store()
 {
     // Must store to get all fields
     if ($this->_final_store) {
         $this->loadRefsFwd();
         $this->_ref_params_paie->loadRefsFwd();
         $this->updateFormFields();
         // Création du template
         $smarty = new CSmartyDP();
         $smarty->assign("fichePaie", $this);
         $this->final_file = $smarty->fetch("print_fiche.tpl");
         file_put_contents("tmp/fichePaie.htm", $this->final_file);
     }
     return parent::store();
 }
Example #7
Show file File: CMediusersStats.class.php Project: fbone/mediboard4
0
 /**
  * Display the total matrix templage
  *
  * @param string $title Locale string for template title
  *
  * @return void
  */
 function display($title)
 {
     // Prepare groups-functions-users hierarchy
     $user = CMediusers::get();
     /** @var CMediusers[] $users     */
     /** @var CFunctions[] $functions */
     /** @var CGroups[]    $groups    */
     $users = $user->loadAll(array_keys($this->totals));
     $functions = CStoredObject::massLoadFwdRef($users, "function_id");
     $groups = CStoredObject::massLoadFwdRef($functions, "group_id");
     foreach ($users as $_user) {
         $_user->loadRefFunction()->loadRefGroup();
         // Function-users linkage
         $function = $functions[$_user->function_id];
         $function->_ref_users[$_user->_id] = $_user;
         // Group-functions linkage
         $group = $groups[$function->group_id];
         $group->_ref_functions[$function->_id] = $function;
         $display_errors = ini_set("display_errors", false);
         foreach ($this->totals[$_user->_id] as $_date => $_values) {
             foreach ($_values as $_part => $_value) {
                 if (is_numeric($_value)) {
                     @($this->sections[$function->_guid][$_date][$_part] += $_value);
                     @($this->sections[$group->_guid][$_date][$_part] += $_value);
                 }
             }
         }
         ini_set("display_errors", $display_errors);
     }
     // Display the template
     $smarty = new CSmartyDP();
     $smarty->assign("period", $this->period);
     $smarty->assign("dates", $this->dates);
     $smarty->assign("min_date", $this->min_date);
     $smarty->assign("max_date", $this->max_date);
     $smarty->assign("totals", $this->totals);
     $smarty->assign("sections", $this->sections);
     $smarty->assign("cells", $this->cells);
     $smarty->assign("users", $users);
     $smarty->assign("functions", $functions);
     $smarty->assign("groups", $groups);
     $smarty->assign("title", $title);
     $smarty->display("../../../modules/mediusers/templates/user_stats.tpl");
 }
Example #8
Show file File: CView.class.php Project: fbone/mediboard4
0
 /**
  * Close the parameter list definition and provides inspection information on info mode
  *
  * @return void
  */
 public static function checkin()
 {
     if (CValue::request("enslave")) {
         CView::enforceSlave();
     }
     if (!CValue::request("info")) {
         return;
     }
     // Dump properties on raw
     if (CValue::request("raw")) {
         echo json_encode(self::$props);
         CApp::rip();
     }
     // Show properties
     $smarty = new CSmartyDP("modules/system");
     $smarty->assign("props", self::$props);
     $smarty->display("view_info.tpl");
     CApp::rip();
 }
Example #9
Show file File: do_repas_aed.php Project: fbone/mediboard4
0
 function doRedirect($demandeSynchro = false)
 {
     if ($this->ajax) {
         if ($this->synchro) {
             $del = CValue::post("del", 0);
             $tmp_repas_id = CValue::post("_tmp_repas_id", 0);
             $msgSystem = CAppUI::getMsg();
             $smarty = new CSmartyDP("modules/dPrepas");
             $smarty->assign("del", $del);
             $smarty->assign("tmp_repas_id", $tmp_repas_id);
             $smarty->assign("demandeSynchro", $demandeSynchro);
             $smarty->assign("msgSystem", $msgSystem);
             $smarty->assign("callBack", $this->callBack);
             if ($demandeSynchro) {
                 $smarty->assign("object", $this->_old);
             }
             $smarty->display("add_del_repas_offline.tpl");
         }
         CApp::rip();
     }
     if ($this->redirect !== null) {
         CAppUI::redirect($this->redirect);
     }
 }
Frequently Used Methods