Code Search for Developers
 
 
  

subroutines.php from ECP (EliteCore Project) at Krugle


Show subroutines.php syntax highlighted

<?php
class AdminModule extends Module {
	function adminDefault() {
		$this->showMenu();
		$TA = new TA();
		$TA->addQuery(TA :: SELECT, "xcs_engine_config", "pagetitle");
		$TA->addParam("value");
		$TA->WHERE("`name`='pagetitle'");
		$TA->LIMIT(1);
		$TA->addQuery(TA :: SELECT, "xcs_engine_config", "description");
		$TA->addParam("value");
		$TA->WHERE("`name`='description'");
		$TA->LIMIT(1);
		$TA->addQuery(TA :: SELECT, "xcs_engine_config", "keywords");
		$TA->addParam("value");
		$TA->WHERE("`name`='keywords'");
		$TA->LIMIT(1);
		$TA->Execute();

		$pagetitle = '';
		$object = $TA->Result("pagetitle")->FetchObject();
		if (isset ($object->value))
			$pagetitle = $object->value;

		$description = '';
		$object = $TA->Result("description")->FetchObject();
		if (isset ($object->value))
			$description = $object->value;

		$keywords = '';
		$object = $TA->Result("keywords")->FetchObject();
		if (isset ($object->value))
			$keywords = $object->value;

		$TA->End();
		$themes = Modules :: ManagerloadModule("themes");
		$this->addContent("sys_admin.php");
		$this->registerVariable($pagetitle, "pagetitle");
		$this->registerVariable($description, "description");
		$this->registerVariable($keywords, "keywords");
		if ($themes) {
			$admin_themes = $themes->object->getAdminThemes();
			$themes = $themes->object->getThemes();
			$this->registerVariable($admin_themes, "admin_themes");
			$this->registerVariable($themes, "themes");
		}
	}
	function adminSave_changes() {
		$TA = new TA();
		$TA->addQuery(TA :: UPDATE, "xcs_engine_config");
		$TA->addParam("value", TA :: STRING, $_POST['pagetitle']);
		$TA->WHERE("`name`='pagetitle'");
		$TA->LIMIT(1);
		$TA->addQuery(TA :: UPDATE, "xcs_engine_config");
		$TA->addParam("value", TA :: STRING, $_POST['description']);
		$TA->WHERE("`name`='description'");
		$TA->LIMIT(1);
		$TA->addQuery(TA :: UPDATE, "xcs_engine_config");
		$TA->addParam("value", TA :: STRING, $_POST['keywords']);
		$TA->WHERE("`name`='keywords'");
		$TA->LIMIT(1);
		if (isset ($_POST['theme'])) {
			$TA->addQuery(TA :: UPDATE, "xcs_engine_config");
			$TA->addParam("value", TA :: STRING, $_POST['theme']);
			$TA->WHERE("`name`='theme'");
			$TA->LIMIT(1);
		}
		if (isset ($_POST['admin_theme'])) {
			$TA->addQuery(TA :: UPDATE, "xcs_engine_config");
			$TA->addParam("value", TA :: STRING, $_POST['admin_theme']);
			$TA->WHERE("`name`='admin_theme'");
			$TA->LIMIT(1);
		}
		$TA->addQuery(TA :: UPDATE, "xcs_engine_config");
		$TA->addParam("value", TA :: STRING, $_POST['adminThemeMode']);
		$TA->WHERE("`name`='admin_theme_mode'");
		$TA->LIMIT(1);
		$TA->Execute();
		$TA->End();
		Engine :: Redirect("index.php?file=admin");
	}
	public function showMenu() {
		if (User :: inAdmin()) {
			if (User :: $profile->admin == 1) {
				$this->addContent('content_admin.php', $this->getAdminPosition());
				if (empty ($_GET['module']))
					$this->addContent('welcome.php', 2);
			} else {
				$this->addContent('content_admin_lite.php', $this->getAdminPosition());
			}
		} else {
			$this->addContent('content.php', $this->getPosition());
		}
		$this->registerVariable($this->localeString('admin', 'administration'), 'administration');

	}
	function onUp() {
		$height = $_GET['height'] - 1;

		$TA = new TA();
		$TA->addQuery(TA :: UPDATE, "xcs_engine_modules");
		$TA->addParam("height", TA :: NUMBER, $_GET['height']);
		$TA->WHERE("height=" . $height . " AND position=" . $_GET['pos']);
		$TA->LIMIT(1);
		$TA->addQuery(TA :: UPDATE, "xcs_engine_modules");
		$TA->addParam("height", TA :: NUMBER, $height);
		$TA->WHERE("id=" . $_GET['id']);
		$TA->LIMIT(1);
		$TA->Execute();
		$TA->End();
		$modules = ModulesManager :: loadModule("modules");
		$modules->object->repairHeight($_GET['pos']);
		Location :: Redirect("index.php", ENGINE :: FORCEURL);
	}
	function onDown() {

		$height = $_GET['height'] + 1;

		$TA = new TA();
		$TA->addQuery(TA :: UPDATE, "xcs_engine_modules");
		$TA->addParam("height", TA :: NUMBER, $_GET['height']);
		$TA->WHERE("height=" . $height . " AND position=" . $_GET['pos']);
		$TA->LIMIT(1);
		$TA->addQuery(TA :: UPDATE, "xcs_engine_modules");
		$TA->addParam("height", TA :: NUMBER, $height);
		$TA->WHERE("id=" . $_GET['id']);
		$TA->LIMIT(1);
		$TA->Execute();
		$TA->End();
		$modules = ModulesManager :: loadModule("modules");
		$modules->object->repairHeight($_GET['pos']);
		Location :: Redirect("index.php", ENGINE :: FORCEURL);
	}
	function onDefault() {
		$this->showMenu();
	}
}
?>



See more files for this project here

ECP (EliteCore Project)

EliteCore Project is a PHP5.1/Javascript/AJAX/XHTML/CSS framework for creating WEB 2.0 applications and services.The basic open-source instalation can be also used as an interactive personal page or BLOG.This project uses the latest features available.

Project homepage: http://sourceforge.net/projects/elitecore
Programming language(s): JavaScript,PHP,XML
License: cpl

  language/
    czech.xml
    english.xml
  templates/
    default/
      images/
        bg.png
        down.jpg
        up.jpg
      content.php
      content_admin.php
      main.css
      modules_hidden_menu.php
      modules_menu.php
      sys_admin.php
      welcome.php
  admin.php
  config.xml
  modules_hidden_menu.php
  modules_menu.php
  subroutines.php