Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetHTML()
- {
- // Change also in siteConfig.php
- $modules_tbl = cache_engine::get("modules_lang" . CRM::$GLOBALS["lang"], function(){
- return CRM::sql_getLines("
- SELECT *
- FROM
- " . CRM::$GLOBALS["fullprefix"] . "modules dat
- LEFT JOIN
- (
- SELECT *
- FROM " . CRM::$GLOBALS["fullprefix"] . "modules_content
- ORDER BY IF(langId = " . CRM::$GLOBALS["lang"] . ", 1, 0) DESC
- ) cnt ON dat.id = cnt.parentId
- GROUP BY dat.id
- ", "moduleName");
- }, 48);
- if (is_file($this->fileSrc) && ($modules_tbl[$this->module]["active"] == 1 || IsAdmin()))
- {
- // Admin mode
- if ($modules_tbl[$this->module]["active"] != 1 && IsAdmin())
- {
- echo "<form action=\"/admin/Modules/insert\" method=\"post\"><input type=\"hidden\" name=\"moduleName\" value=\"{$this->module}\" /><input type=\"hidden\" name=\"modulesDir\" value=\"{$this->module}\" /><div style=\"direction:ltr; text-align:left; padding:8px; border:1px dashed #dbdbdb; background:#ffffec; color:#333;\"><input type=\"submit\" class=\"u\" style=\"padding:0px; margin:0px; border:none; background:none; cursor:pointer;\" value=\"Click here\"> to activate this module so regular users can see this.</div></form>";
- }
- if ($this->page == "") $this->page = "index";
- $pname = $this->page;
- $mdl = Module::GetObject($this->module);
- if (!$mdl || !method_exists($mdl, $pname)) $returnValue = "ERRORPAGE";
- else
- {
- $chcVar = "chc_" . $this->page; // . "-" . $_SERVER['QUERY_STRING'];
- if (isset($mdl->$chcVar) && $mdl->$chcVar > 0)
- {
- $pg_content = cache_page($mdl, $pname, $mdl->$chcVar, $this->module . "_" . $pname);
- }
- else $pg_content = $mdl->$pname();
- $returnValue = $mdl->Wrapper($pg_content);
- }
- }
- else $returnValue = "ERRORPAGE";
- if ($returnValue == "ERRORPAGE")
- {
- header("HTTP/1.1 404 Not Found");
- header('Location: /404');
- exit;
- }
- if ($returnValue == "REQUIRE_LOGIN")
- {
- return "<script type=\"text/javascript\"> $(function(){ $('#page').trigger('REQUIRE_LOGIN'); }); </script>";
- }
- return ($returnValue);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement