Example #1
0
function _fetch($path, $params = array())
{
    global $_assigns;
    $templatePath = $path;
    $gui = new gui();
    if ($_assigns) {
        foreach ($_assigns as $name => $value) {
            $gui->assign($name, $value);
        }
    }
    foreach ($params as $name => $value) {
        // echo "param: $name => $value\n";
        $gui->assign($name, $value);
    }
    return $gui->fetch($templatePath . '.tpl');
}
 public function RPCObjectGetList()
 {
     switch ($this->ObjectConf['ClassName']) {
         case 'User':
             return User::getList("");
         case 'Group':
             return Group::getList("");
         case 'gui':
             return gui::getList("");
         default:
             return null;
     }
 }
     }
   }
}
// -->
</script>
</head>
<body>

<?php 
require_once dirname(__FILE__) . "/../classes/class_administration.php";
require_once dirname(__FILE__) . "/../classes/class_gui.php";
$admin = new administration();
$permguis = $admin->getGuisByPermission(Mapbender::session()->get("mb_user_id"), true);
###export
if ($guiList) {
    $gui = gui::byName($guiList);
    try {
        $insert = $gui->toSql();
    } catch (Exception $e) {
        $insert = $e->message;
    }
    echo "<textarea rows=40 cols=80>";
    echo htmlentities($insert, ENT_QUOTES, CHARSET);
    echo "</textarea>";
}
###
if (!$guiList) {
    $v = array();
    $t = array();
    $sql = "SELECT * FROM gui WHERE gui_id IN (";
    for ($i = 0; $i < count($permguis); $i++) {
Example #4
0
// Searching controllers in Modules directory.
// Directory Scan function - script will include all .php files in the modules
// directory.
if (!is_dir(MODULE_PATH)) {
    die(_("ERROR: Modules directory not found!"));
}
$CurDir = dir(MODULE_PATH);
while (false !== ($entry = $CurDir->read())) {
    if ($entry != "." && $entry != "..") {
        if (substr($entry, strrpos($entry, '.')) == ".php") {
            require_once $CurDir->path . "/" . $entry;
        }
    }
}
try {
    // Validate and set the template of the site.
    gui::set_template_name(config::get("template_name", "gui"));
    // Looking for extra functions file in the template directory.
    if (is_file(TEMPLATE_PATH . config::get("template_name", "gui") . "/functions.php")) {
        include_once TEMPLATE_PATH . config::get("template_name", "gui") . "/functions.php";
    }
    // Find Controller name run it.
    gui::add_body(controller::set(uriparser::current()));
    // Validate and set the template filename with language settings.
    gui::set_template_file(config::get("controller"), config::get("lang"));
} catch (Exception $exc) {
    gui::add_body(gui::render_404($exc->getMessage()));
    //die(gui::render_404 ( _("Error. Page not found.")));
}
// Connecting of previosly finded template file.
include_once TEMPLATE_PATH . config::get("template_name", "gui") . "/" . config::get("template_file", "gui") . ".php";
Example #5
0
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="container mainframe">
            <div class="row header">
                <div class="col-md-2 text-center">
                    <a href="<?php 
uriparser::link();
?>
"><img src="<?php 
gui::template_host();
?>
img/volgmed-herb.png" class="img-responsive"></a>
                </div>
                <div class="col-md-5">
                  <img src="<?php 
gui::template_host();
?>
img/volgmed-title-2.png" class="img-responsive">
                </div>
                <div class="col-md-5">
                </div>
            </div>
            <?php 
include gui::template_path() . "mmenu.php";
?>

Example #6
0
#!/usr/bin/php
<?php 
/* UbFoInfo */
/* UbFoInfo is a program to provide good info to online communities and is tailor made for ubuntu */
?>
===========================
==> UbFoInfo V0.1 Alpha <==
===========================
<?php 
include "functions.php";
if ($argc > 1) {
    cli::go();
} else {
    gui::go();
}
exit(0);
  AND e_element <> 'iframe' 
  AND gui_element.fkey_gui_id = \$1 
  AND gui_element_vars.fkey_gui_id = \$1 
  AND var_type = 'text/css' 
ORDER BY var_name

SQL;
$v = array($gui_id);
$t = array('s');
$res = db_prep_query($sql, $v, $t);
$cnt = 0;
while ($row = db_fetch_array($res)) {
    echo $row["var_value"] . "\n";
}
?>
-->
</style>
<script type='text/javascript' src='../javascripts/core.php'></script>
</head>
<?php 
if (defined(LOAD_JQUERY_FROM_GOOGLE) && LOAD_JQUERY_FROM_GOOGLE) {
    echo "<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>";
}
$currentApplication = new gui($gui_id);
echo $currentApplication->toHtml();
$mapPhpParameters = htmlentities($urlParameters, ENT_QUOTES, CHARSET);
$mapPhpParameters .= "&amp;" . htmlentities($_SERVER["QUERY_STRING"]);
echo "<script type='text/javascript' src='../javascripts/map.php?" . $mapPhpParameters . "'></script>";
?>
</html>
 $selected_user = db_insert_id('platzhalter', 'mb_user', 'mb_user_id');
 $sql_owner = "Update mb_user SET mb_user_owner = \$1 ";
 $sql_owner .= " WHERE mb_user_name = \$2 ";
 $v = array(1, $name);
 #$selected_user;
 $t = array('i', 's');
 $res_owner = db_prep_query($sql_owner, $v, $t);
 # removed, because a new user may be inserted in a group with too many privileges
 $sql_group = "Insert INTO mb_user_mb_group (fkey_mb_user_id, fkey_mb_group_id) VALUES ";
 $sql_group .= "(\$1, \$2) ";
 $v = array($selected_user, 20);
 $t = array('i', 'i');
 $res_group = db_prep_query($sql_group, $v, $t);
 // CB (begin)
 // adding new GUIs for new user (copies of gui and gui1 with owner rights)
 $gui = new gui();
 $admin = new administration();
 //create new name for gui
 $gui_id1 = $admin->getGuiIdByGuiName("gui");
 $gui_id2 = $admin->getGuiIdByGuiName("gui1");
 $gui_id3 = $admin->getGuiIdByGuiName("gui2");
 $gui_id4 = $admin->getGuiIdByGuiName("gui_digitize");
 $gui_newName1 = $name . "_gui";
 $gui_newName2 = $name . "_gui1";
 $gui_newName3 = $name . "_gui2";
 $gui_newName4 = $name . "_gui_digitize";
 //check if new gui names are already taken
 while ($gui->guiExists($gui_newName1)) {
     $gui_newName1 .= "_1";
 }
 while ($gui->guiExists($gui_newName2)) {
<?php

# License:
# Copyright (c) 2009, Open Source Geospatial Foundation
# This program is dual licensed under the GNU General Public License
# and Simplified BSD license.
# http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
require_once dirname(__FILE__) . "/../php/mb_validateSession.php";
require_once dirname(__FILE__) . "/../classes/class_gui.php";
require_once dirname(__FILE__) . "/../classes/class_user.php";
$ajaxResponse = new AjaxResponse($_POST);
switch ($ajaxResponse->getMethod()) {
    case "sql":
        $application = new gui($ajaxResponse->getParameter("applicationId"));
        $user = new User();
        $apps = $user->getApplicationsByPermission();
        if (in_array($application->id, $apps)) {
            $sql = $application->toSql();
            $resultObj = array("sql" => $sql);
            $ajaxResponse->setResult($resultObj);
            $ajaxResponse->setSuccess(true);
            break;
        }
        $ajaxResponse->setSuccess(false);
        $ajaxResponse->setMessage(_mb("You are not allowed to access this application."));
        break;
    default:
        $ajaxResponse->setSuccess(false);
        $ajaxResponse->setMessage(_mb("An unknown error occured."));
        break;
}
Example #10
0
 public static function add_body($text = "")
 {
     if (empty($text)) {
         return false;
     }
     self::$PageBody = $text;
     return true;
 }
Example #11
0
            <li>
                <img src="<?php 
gui::template_host();
?>
img/no-photo.jpg">
                <div class="overflow">
                    <div class="date-1">
                        <time datetime="2014-11-12 13:00:00">12.11.2014</time>
                        <span>Tempor incididunt ut labore et</span>
                    </div>
                    <p>Eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.</p>
                    <a href="#" class="btn btn-default">Читать далее</a>
                </div>
            </li>
        </ul>
        <a href="<?php 
uriparser::link("news/");
?>
" class="link-1">Просмотреть все новости</a>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <?php 
gui::body();
?>
    </div>
</div>
<?php 
include gui::template_path() . "footer.php";
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once dirname(__FILE__) . "/../php/mb_validateSession.php";
require_once dirname(__FILE__) . "/mb_validateInput.php";
require_once dirname(__FILE__) . "/../classes/class_universal_wfs_factory.php";
require_once dirname(__FILE__) . "/../classes/class_gui.php";
echo "file: " . $_REQUEST["xml_file"];
echo "<br>-------------------------------<br>";
$guiList = mb_validateInput($_REQUEST["guiList"]);
$url = mb_validateInput($_REQUEST["xml_file"]);
$myWfsFactory = new UniversalWfsFactory();
$myWfs = $myWfsFactory->createFromUrl($url);
if (is_null($myWfs)) {
    echo "WFS could not be uploaded.";
    die;
}
$myWfs->insertOrUpdate();
// link WFS to GUIs in $guiList
$guiArray = explode(",", $guiList);
foreach ($guiArray as $appName) {
    $currentApp = new gui($appName);
    $currentApp->addWfs($myWfs);
}
echo $myWfs;
			} 
			else{
				alert("Please select a GUI!");
			}
		}
	}
}
</script>
</head>
<body>
<?php 
require_once dirname(__FILE__) . "/../classes/class_administration.php";
require_once dirname(__FILE__) . "/../classes/class_gui.php";
###rename
if ($rename || $copy) {
    $gui = new gui();
    if ($copy) {
        if ($_POST['withU'] == 'true') {
            $gui->copyGui($guiList, $newGuiName, true);
        } else {
            $gui->copyGui($guiList, $newGuiName, false);
        }
    } elseif ($rename) {
        $gui->renameGui($guiList, $newGuiName);
    }
    $rename = 0;
    $copy = 0;
}
###
$admin = new administration();
$ownguis = $admin->getGuisByOwner(Mapbender::session()->get("mb_user_id"), true);