Code Search for Developers
 
 
  

admin.1.php from ECP (EliteCore Project) at Krugle


Show admin.1.php syntax highlighted

<?php
switch ($_GET['op']) {
	case "list_dir" :

		if (isset ($_GET['path']))
			$path = $_GET['path']."/";
		else
			$path = "";
		unset ($_GET['path']);
		$currentModule->addContent("admin_picture.php");
		$currentModule = $XCS->loadModule("directory_listing");
		$currentModule->object = new module_directory_listing();
		$currentModule->object->setRoot($_GET['root']);
		$currentModule->object->readPath($path);
		//$link = "<a href=\"#\" onClick=\"setPicture(".$_GET['section'].",'__PATH____FILE__');\">__FILE__</a>";
		$link = "<a href=\"#\" onClick=\"setPicture(".$_GET['section'].",'__PATH____FILE__');\" onMouseOver=\"return XCS_popupShow('&lt;img src=\'modules/menu/images/__PATH____FILE__\' /&gt;',-1,'__FILE__');\" onMouseOut=\"return XCS_popupHide();\">__FILE__</a>";
		$currentModule->object->link = $link;
		$currentModule->object->printPath();
		$currentModule->registerVariable($path, "path");
		break;
	case "change_item" :

		if (!isset ($_POST['id'])) {
			$_POST['id'] = 0;
			$item->id = 0;
		}
		else {
			$item = $currentModule->object->getItemByID($_POST['id']);
		}
		$parts = explode(";", $_POST['module']);
		if (sizeof($parts) == 2) {
			$_POST['module'] = $parts[0];
			$site = $parts[1];
		}
		if ($_POST['module'] != $currentModule->form__no_module) {

			$mainModule = $currentModule; // backup current module
			$TA = new TA($currentModule);
			$TA->addQuery(TA :: SELECT, "xcs_engine_modules");
			$TA->WHERE("id=".$_POST['module']);
			$TA->LIMIT(1);
			$TA->Execute();

			$object = $TA->Result()->FetchObject();
			$TA->End();
			if ($object->instance_name != "none")
				$module = $object->instance_name;
			else
				$module = $object->base;
			$currentModule = $XCS->loadModule($module);
			DB::SetPrefix($site);
			$resources = $currentModule->getResources();
			DB::RestorePrefix();

			$get_modules = $XCS->loadModule("get_modules");
			$get_modules->object = new module_get_modules();
			$templates = $get_modules->object->getTemplates($currentModule->getName()); // load templates of current module instance

			$currentModule = $mainModule; // restore previous module

			$currentModule->addContent("admin_modulelink_change.php");
			$currentModule->registerVariable($resources, "resources");
			$currentModule->registerVariable($site, "site");
		}
		else {
			$currentModule->addContent("admin_link_change.php");
			$templates = array ("default");
		}

		$currentModule->registerVariable($templates, "templates");
		$currentModule->registerVariable($currentModule, "currentModule");
		$currentModule->registerVariable($item, "item");
		$currentModule->registerVariable($XCS->getGroupNames(), "ranks");
		break;
	case "save_changes" :
		$TA = new TA($currentModule);
		if ($_POST['module'] != $currentModule->form__no_module) {
			if ($_POST['resource'] != "false") {
				$link = $_POST['resource'];
			}
			else {
				$TA->addQuery(TA :: SELECT, "xcs_engine_modules");
				$TA->WHERE("id=".$_POST['module']);
				$TA->LIMIT(1);
				$TA->Execute();

				$object = $TA->Result()->FetchObject();
				$TA->removeQuery();
				if ($object->instance_name != "none")
					$module = $object->instance_name;
				else
					$module = $object->base;
				if ($object->block != "none")
					$block = "&amp;block=".$object->block;
				else
					$block = "";
				$link = "index.php?module=".$module.$block;
			}
		}
		else {
			$link = $_POST['link'];
		}

		if ($_POST['id'] != 0) {
			$TA->addQuery(TA :: UPDATE, "xcs_module_menu");
			$TA->addParam("name", TA :: STRING, $_POST['name']);
			$TA->addParam("template", TA :: STRING, $_POST['template']);
			$TA->addParam("link", TA :: STRING, $link);
			//$TA->addParam("picture", TA :: STRING, $_POST['picture1']);
			$TA->addParam("group", TA :: NUMBER, $_POST['group']);
			$TA->addParam("status", TA :: NUMBER, $_POST['status']);
			$TA->WHERE("id=".$_POST['id']);
			$TA->LIMIT(1);
			$TA->Execute();
			$TA->removeQuery();
		}
		else {
			$TA->addQuery(TA :: INSERT, "xcs_module_menu");
			$TA->addParam("name", TA :: STRING, $_POST['name']);
			$TA->addParam("template", TA :: STRING, $_POST['template']);
			$TA->addParam("link", TA :: STRING, $link);
			//$TA->addParam("picture", TA :: STRING, $_POST['picture1']);
			$TA->addParam("height", TA :: NUMBER, $currentModule->object->getNextHeight());
			$TA->addParam("group", TA :: NUMBER, $_POST['group']);
			$TA->addParam("status", TA :: NUMBER, $_POST['status']);
			$TA->Execute();
			$TA->removeQuery();
		}
		$TA->End();
		$currentModule->addContent("admin_saved.php");
		break;
	case "new" :
		$get_modules = $XCS->loadModule("get_modules");
		$get_modules->object = new module_get_modules();
		$modules = $get_modules->object->getDBModulesByOutput(1);
		$currentModule->addContent("admin_new.php");
		$currentModule->registerVariable($currentModule, "currentModule");
		$currentModule->registerVariable($modules, "modules");
		$currentModule->registerVariable($XCS->getGroupNames(), "ranks");
		break;
	case "edit" :
		$item = $currentModule->object->getItemByID($_GET['id']);

		$get_modules = $XCS->loadModule("get_modules");
		$get_modules->object = new module_get_modules();
		$modules = $get_modules->object->getDBModulesByOutput(1);

		$currentModule->addContent("admin_edit.php");
		$currentModule->registerVariable($currentModule, "currentModule");
		$currentModule->registerVariable($item, "item");
		$currentModule->registerVariable($modules, "modules");
		$currentModule->registerVariable($XCS->getGroupNames(), "ranks");
		break;
	case "remove" :
		$TA = new TA($currentModule);
		$TA->addQuery(TA :: DELETE, "xcs_module_menu");
		$TA->WHERE("id=".$_GET['id']);
		$TA->LIMIT(1);
		$TA->Execute();
        $TA->End();

		$currentModule->object->getItems();
		$currentModule->addContent("admin_content.php");
		$currentModule->registerVariable($currentModule, "currentModule");
		$currentModule->registerVariable($currentModule->object->items, "items");

		break;
	case "change_height" :
		if ($_GET['direction'] == "up")
			$new_height = $_GET['height'] - 1;
		else
			if ($_GET['direction'] == "down")
				$new_height = $_GET['height'] + 1;

		$TA = new TA($currentModule);

		// free next place - update existing item (existing_item=>old_place)
		$TA->addQuery(TA :: UPDATE, "xcs_module_menu");
		$TA->addParam("height", TA :: NUMBER, $_GET['height']);
		$TA->WHERE("height=".$new_height);
		$TA->LIMIT(1);
		// save current item to this place (selected_item=>new_place)
		$TA->addQuery(TA :: UPDATE, "xcs_module_menu");
		$TA->addParam("height", TA :: NUMBER, $new_height);
		$TA->WHERE("id=".$_GET['id']);
		$TA->LIMIT(1);
		$TA->Execute();
        $TA->End();

		$currentModule->object->getItems();
		$currentModule->addContent("admin_content.php");
		$currentModule->registerVariable($currentModule, "currentModule");
		$currentModule->registerVariable($currentModule->object->items, "items");

		break;
	case "change_status" :
		$TA = new TA($currentModule);
		$TA->addQuery(TA :: UPDATE, "xcs_module_menu");
		$TA->WHERE("`id`='".$_GET['id']."'");
		$TA->LIMIT(1);
	    if ($_GET['status'] == "active") {
			$TA->addParam("status", TA :: NUMBER, 0);
		}
		else
			if (($_GET['status'] == "not_active")) {
				$TA->addParam("status", TA :: NUMBER, 1);
			}
		$TA->Execute();
		$TA->End();
	default :
		$currentModule->object->getItems();
		$currentModule->addContent("admin_content.php");
		$currentModule->registerVariable($currentModule, "currentModule");
		$currentModule->registerVariable($currentModule->object->items, "items");
}
?>



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

  images/
    book.gif
    downloads.gif
    faq.gif
    forums.gif
    home.gif
    none.jpg
    users.gif
  language/
    czech.xml
    english.xml
  templates/
    default/
      images/
        delete.png
        down.jpg
        edit.png
        icon.jpg
        off.png
        on.png
        up.jpg
      admin_content.php
      admin_edit.php
      admin_link_change.php
      admin_modulelink_change.php
      admin_new.php
      admin_picture.php
      admin_saved.php
      content.php
    icons_only/
      images/
        delete.png
        down.jpg
        edit.png
        icon.jpg
        off.png
        on.png
        up.jpg
      content.php
    mise_static/
      images/
        delete.png
        down.jpg
        edit.png
        icon.jpg
        off.png
        on.png
        up.jpg
      admin_content.php
      admin_edit.php
      admin_link_change.php
      admin_modulelink_change.php
      admin_new.php
      admin_picture.php
      admin_saved.php
      content.php
    nasehory/
      images/
        delete.png
        down.jpg
        edit.png
        icon.jpg
        off.png
        on.png
        up.jpg
      content.php
    no_icons/
      images/
        delete.png
        down.jpg
        edit.png
        icon.jpg
        off.png
        on.png
        up.jpg
      content.php
    text_inline/
      images/
        delete.png
        down.jpg
        edit.png
        icon.jpg
        off.png
        on.png
        up.jpg
      content.php
  admin.1.php
  class.1.php
  config.xml
  install.sql.tpl
  module.1.php
  subroutines.php
  uninstall.sql.tpl