Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class index

Helixindex
Hide Inherited MembersHelix Core
Description
No description.
 
Constants
No constants.
 
Properties
 
Methods
publicexecute_function ( function_name )[ index ]
Parameters
requiredfunction_name
Code
062  public function execute_function($function_name)
063  {
064      global $sess;
065 
066      $p = new page((AJAX ? null : $sess->last_page_id),(AJAX ? reqval("p") : null),(AJAX ? ADMIN : null));
067      $page_site = SITES . append_slash($p->helix ? "helix" : SITE_NAME);
068      if ($p->id == 0)
069      {
070          error("Session Error","Last Page not found in session.  Codebehind cannot execute function '$function_name'");
071          redirect(SITE_HOME_PAGE);
072      }
073      if (!is_true(AJAX))
074      {
075          debug("CALL FUNCTION : $p->name->$function_name()",__FILE__,__LINE__);
076      }
077 
078      if ($sess->user->check_perms($p->perms) || $function_name=="login" || true)
079      {
080          $template_cb_path = $page_site . "interface/templates/templates.cb.php";
081          if (file_exists($template_cb_path))
082          {
083              require_once($template_cb_path);
084          }
085          else
086          {
087              error("templates.cb.php Does Not Exist","");
088          }
089 
090          $codebehind = $page_site . "interface/pages/{$p->name}/{$p->name}.cb.php";
091          if (file_exists($codebehind))
092          {
093              require_once($codebehind);
094          }
095 
096          if (function_exists($function_name))
097          {
098              return $function_name();
099          }
100          else
101          {
102              debug("'$function_name' does not exist for page '$p->name'",__FILE__,__LINE__);
103              error("Function Error","'$function_name' does not exist for page '$p->name'");
104              return "'$function_name' does not exist for page '$p->name'";
105          }
106      }
107      else
108      {
109          debug("Insufficient permissions to execute '$function_name'",__FILE__,__LINE__);
110          error("Function Error","Insufficient permissions to execute '$function_name'");
111          redirect($sess->last_location);
112      }
113  }
publicset_page ( pagename )[ index ]
Parameters
requiredpagename
Code
004  public function set_page($__pagename)
005  {
006      global $sess,$page;
007 
008      $page = new page(null,$__pagename);
009      if ($page->id > 0)
010      {
011          if ($sess->user->check_perms($page->perms))
012          {
013              if (file_exists($page->path))
014              {
015                  return true;
016              }
017              else
018              {
019                  header("HTTP/1.1 404 Not Found");
020                  error("Page Error","There was an error loading this page.  Page path does not exist.");
021                  $page->render = false;
022              }
023          }
024          else
025          {
026              if ($sess->user->logged_in)
027              {
028                  error("Access Denied","You do not have permission to access to this page.");
029                  $page->render = false;
030              }
031              else
032              {
033                  $sess->register("login_page",($page->helix ? "helix/" : "") . $page->name);
034                     $sess->register("login_query_string",$_SERVER["QUERY_STRING"]);
035                     error("Access Denied","You do not have permission to access this page. Please <a href=\"" . WEBROOT . (ADMIN ? "helix/" : "") . "login\">login</a>.");
036                     $page->render = false;
037              }
038          }
039      }
040      else if (file_exists(PAGE_SITE . "interface/pages/{$__pagename}"))
041      {
042          if (!file_exists(PAGE_SITE . "interface/pages/{$__pagename}/{$__pagename}.php"))
043          {
044              touch(PAGE_SITE . "interface/pages/{$__pagename}/{$__pagename}.php");
045          }
046 
047          if ($page->id==0)
048          {
049              $page->helix = ADMIN;
050              $page->perm = new perm(null,"none");
051              $page->commit();
052          }
053      }
054      else
055      {
056          header("HTTP/1.1 404 Not Found");
057          error("Page Error","There was an error loading this page.  Page record not found.");
058          $page->render = false;
059      }
060  }
 
Accessors
publicpage[ index ]
Code
004  public function set_page($__pagename)
005  {
006      global $sess,$page;
007 
008      $page = new page(null,$__pagename);
009      if ($page->id > 0)
010      {
011          if ($sess->user->check_perms($page->perms))
012          {
013              if (file_exists($page->path))
014              {
015                  return true;
016              }
017              else
018              {
019                  header("HTTP/1.1 404 Not Found");
020                  error("Page Error","There was an error loading this page.  Page path does not exist.");
021                  $page->render = false;
022              }
023          }
024          else
025          {
026              if ($sess->user->logged_in)
027              {
028                  error("Access Denied","You do not have permission to access to this page.");
029                  $page->render = false;
030              }
031              else
032              {
033                  $sess->register("login_page",($page->helix ? "helix/" : "") . $page->name);
034                     $sess->register("login_query_string",$_SERVER["QUERY_STRING"]);
035                     error("Access Denied","You do not have permission to access this page. Please <a href=\"" . WEBROOT . (ADMIN ? "helix/" : "") . "login\">login</a>.");
036                     $page->render = false;
037              }
038          }
039      }
040      else if (file_exists(PAGE_SITE . "interface/pages/{$__pagename}"))
041      {
042          if (!file_exists(PAGE_SITE . "interface/pages/{$__pagename}/{$__pagename}.php"))
043          {
044              touch(PAGE_SITE . "interface/pages/{$__pagename}/{$__pagename}.php");
045          }
046 
047          if ($page->id==0)
048          {
049              $page->helix = ADMIN;
050              $page->perm = new perm(null,"none");
051              $page->commit();
052          }
053      }
054      else
055      {
056          header("HTTP/1.1 404 Not Found");
057          error("Page Error","There was an error loading this page.  Page record not found.");
058          $page->render = false;
059      }
060  }
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads