Ejemplo n.º 1
0
function getCenterPiece(&$centerpiece, &$centerpiecelinks)
{
    $user =& atkGetUser();
    $theme =& atkinstance("atk.ui.atktheme");
    // Set the dispatchfile for this menu based on the theme setting, or to the default if not set.
    // This makes sure that all calls to dispatch_url will generate a url for the main frame and not
    // within the menu itself.
    $dispatcher = $theme->getAttribute('dispatcher', atkconfig("dispatcher", "index.php"));
    // do not use atkSelf here!
    $c =& atkinstance("atk.atkcontroller");
    $c->setPhpFile($dispatcher);
    if ($theme->getAttribute('useframes', true)) {
        $target = 'target="main"';
    } else {
        $target = "";
    }
    //$centerpiece = $centerpiecelinks['pim'] = href(dispatch_url("dashboard.mainboard", "start"), atktext("pim"), SESSION_NEW, false,$target);
    // change location link - if location_name is null there is only one location!
    if ($user['location_id'] !== null) {
        $current_location = atktext('current_location') . ': ' . $user['location_name'];
        $atktarget = "index.php?atknodetype=locations.location&atkaction=change&atklevel=0&atkprevlevel=0&atkselect=[atkprimkey]";
        $params = array("atkfilter" => $filter, "atktarget" => $atktarget);
        $centerpiece = $centerpiecelinks['change_location'] = href(dispatch_url("locations.location", "select", $params), $current_location, SESSION_NEW, false, $target);
    }
    // if user settings is allowed put link to it
    if (is_allowed("loginmanager.settings", "edit") && substr($user['name'], 0, 4) != 'demo') {
        $centerpiece .= '     ';
        $centerpiece .= $centerpiecelinks['userprefs'] = href(dispatch_url("loginmanager.settings", "edit"), atktext("userprefs"), SESSION_NEW, false, $target);
    }
}
Ejemplo n.º 2
0
/**
 * Class for managing activities
 * 
 * @author Sandy Pleyte <*****@*****.**>
 * @package achievo
 * @subpackage crm
 * @since 1.3.0
 */
function smarty_function_crmlastviewed($params, &$smarty)
{
    $eventlog =& atkGetNode("crm.eventlog");
    $userid = atkGetUserId();
    $items = $eventlog->getRecentlyViewed($userid);
    $theme =& atkinstance("atk.ui.atktheme");
    $tpl = $theme->tplPath("crm_lastviewed.tpl");
    if ($theme->tplPath("crm_lastviewed.tpl")) {
        $ui =& atkinstance("atk.ui.atkui");
        return $ui->render('crm_lastviewed.tpl', array("items" => $items));
    }
    return "no template ?";
}
Ejemplo n.º 3
0
function show_notification_window($content, $closebutton = true, $windowtitle = "")
{
    if (!$windowtitle) {
        $windowtitle = atktext('notice');
    }
    $content .= '<br>';
    if ($closebutton == true) {
        $buttonlink = 'true';
    }
    $page =& atknew("atk.ui.atkpage");
    $ui =& atkinstance("atk.ui.atkui");
    $output =& atkOutput::getInstance();
    $page->register_style($ui->stylePath("style.css"));
    $res = $ui->renderBox(array("closebutton" => $buttonlink, "content" => $content), "error");
    $page->addContent($res);
    $output->output($page->render($windowtitle));
    $output->outputFlush();
}
Ejemplo n.º 4
0
 *
 * @copyright (c)2000-2004 Ibuildings.nl BV
 * @license http://www.achievo.org/atk/licensing ATK Open Source License
 *
 * @version $Revision$
 * $Id$
 */
/**
 * @internal includes
 */
$config_atkroot = "./";
include_once "atk.inc";
atksession();
atksecure();
require "theme.inc";
atkimport("atk.ui.atktheme");
$output =& atkOutput::getInstance();
$page =& atkinstance("atk.ui.atkpage");
$page->unregister_all_scripts();
$theme =& atkTheme::getInstance();
$ui =& atkinstance("atk.ui.atkui");
/* general menu stuff */
/* load menu layout */
atkimport("atk.menu.atkmenu");
$menu =& atkMenu::getMenu();
if (is_object($menu)) {
    $output->output($menu->render());
} else {
    atkerror("no menu object created!");
}
$output->outputFlush();
Ejemplo n.º 5
0
/**
 * Implements the {atkthemeimg} plugin for use in templates.
 *
 * The atkthemeicon plugin retrieves an icon path from the theme, while
 * respecting inheritance within the theme. In other words, if
 * a theme derives from the default theme, but does not define a
 * new version of 'someimg.jpg', then {atkthemeimg someimg.jpg} will
 * display the path to the default theme version of the same.
 *
 * Params: 
 * - name: the name of the icon to retrieve
 * - type: the icon type (recordlist etc.)
 *
 * Example:
 * <img src="{atkthemeicon name='delete' type='recordlist'}">
 *
 * @author Peter C. Verhage <*****@*****.**>
 *
 */
function smarty_function_atkthemeicon($params, &$smarty)
{
    $theme =& atkinstance("atk.ui.atktheme");
    return $theme->iconPath($params['name'], $params['type']);
}
Ejemplo n.º 6
0
/**
 * Implements the {atkloadscript} plugin for use in templates.
 *
 * The atkloadscript plugin registers a javascript code in the current page
 * to be used in the onLoad of the body.
 * 
 * Params:
 * 0/code The javascript code to load.
 *
 * Example:
 * {atkscript "alert('Hello World!');"}
 *
 * @author Boy Baukema <*****@*****.**>
 */
function smarty_function_atkloadscript($params)
{
    $page =& atkinstance('atk.ui.atkpage');
    $page->register_loadscript($params[0] ? $params[0] : $params['code']);
}
Ejemplo n.º 7
0
    $destination = "index.php?atklogout=true";
    if (isset($ATK_VARS["atknodetype"]) && isset($ATK_VARS["atkaction"])) {
        $destination .= "&atknodetype=" . $ATK_VARS["atknodetype"] . "&atkaction=" . $ATK_VARS["atkaction"];
        if (isset($ATK_VARS["atkselector"])) {
            $destination .= "&atkselector=" . $ATK_VARS["atkselector"];
        }
    }
    $title = atktext("title_session_expired");
    $contenttpl = '<br>%s<br><br><input type="button" onclick="top.location=\'%s\';" value="%s"><br><br>';
    $content = sprintf($contenttpl, atktext("explain_session_expired"), str_replace("'", "\\'", $destination), atktext("relogin"));
    $box = $ui->renderBox(array("title" => $title, "content" => $content));
    $page->addContent($box);
    $output->output($page->render(atktext("title_session_expired"), true));
} else {
    atksecure();
    atkimport("atk.ui.atkpage");
    $lockType = atkconfig("lock_type");
    if (!empty($lockType)) {
        atklock();
    }
    $flags = array_key_exists("atkpartial", $ATK_VARS) ? HTML_PARTIAL : HTML_STRICT;
    //Load controller
    if ($ATK_VARS["atkcontroller"] == "") {
        $controller =& atkinstance("atk.atkcontroller");
    } else {
        $controller =& atkinstance($ATK_VARS["atkcontroller"]);
    }
    //Handle http request
    $controller->dispatch($ATK_VARS, $flags);
}
$output->outputFlush();
Ejemplo n.º 8
0
 * @internal includes
 */
$config_atkroot = "./";
include_once "atk.inc";
include_once "atk/atkbrowsertools.inc";
include_once "achievotools.inc";
atksession();
atksecure();
include "theme.inc";
$theme =& atkinstance('atk.ui.atktheme');
if (atkconfig("fullscreen")) {
    // Fullscreen mode. Use index.php as launcher, and launch app.php fullscreen.
    $page =& atkinstance("atk.ui.atkpage");
    $ui =& atkinstance("atk.ui.atkui");
    $theme =& atkinstance("atk.ui.atktheme");
    $output =& atkinstance("atk.ui.atkoutput");
    $page->register_style($theme->stylePath("style.css"));
    $page->register_script(atkconfig("atkroot") . "atk/javascript/launcher.js");
    $content = '<script language="javascript">atkLaunchApp(); </script>';
    $content .= '<br><br><a href="#" onClick="atkLaunchApp()">' . atktext('app_reopen', "atk") . '</a> &nbsp; ' . '<a href="#" onClick="window.close()">' . atktext('app_close', "atk") . '</a><br><br>';
    $box = $ui->renderBox(array("title" => atktext("app_launcher"), "content" => $content));
    $page->addContent($box);
    $output->output($page->render(atktext('app_launcher'), true));
    $output->outputFlush();
} else {
    if ($theme->getAttribute('useframes', true)) {
        // Regular mode. app.php can be included directly.
        include "app.php";
    } else {
        $user =& atkGetUser();
        $indexpage =& atknew('atk.ui.atkindexpage');
Ejemplo n.º 9
0
/**
 * Returns the dispatch file.
 *
 * @author Sandy Pleyte <*****@*****.**>
 *
 */
function smarty_function_atkdispatchfile($params, &$smarty)
{
    $c =& atkinstance("atk.atkcontroller");
    return $c->getPhpFile();
}
Ejemplo n.º 10
0
 * included in the distribution.
 *
 * This file is the skeleton dispatcher file, which you can copy
 * to your application dir and modify if necessary. By default, it
 * checks the $atknodetype and $atkaction postvars and creates the
 * node and dispatches the action.
 *
 * @package atk
 * @subpackage skel
 *
 * @author Ivo Jansch <*****@*****.**>
 *
 * @copyright (c)2000-2004 Ivo Jansch
 * @license http://www.achievo.org/atk/licensing ATK Open Source License
 *
 * @version $Revision: 2786 $
 * $Id: debugger.php 6354 2009-04-15 02:41:21Z mvdam $
 */
/**
 * @internal Setup the system
 */
$config_atkroot = "./";
include_once $config_atkroot . "atk/include/initial.inc";
atksession();
atksecure();
$debugger =& atkinstance("atk.utils.atkdebugger");
$output =& atkOutput::getInstance();
$output->output($debugger->renderConsole());
$config_debug = 0;
// force debugging off in console
$output->outputFlush();
Ejemplo n.º 11
0
<?php

atkPage::getInstance()->register_script(atkconfig('atkroot') . 'atk/javascript/overlibmws/overlibmws.js');
$theme = atkinstance("atk.ui.atktheme");
$image = $theme->imgPath("help");
$tooltip = atk_htmlentities(str_replace(array("\r\n", "\r", "\n"), ' ', $tooltip));
?>

<img align="top" src="<?php 
echo $image;
?>
" border="0" style="margin-left: 3px;"
     onmouseover="return overlib( & quot;<?php 
echo $tooltip;
?>
 & quot; , BGCLASS, 'overlib_bg', FGCLASS, 'overlib_fg', TEXTFONTCLASS, 'overlib_txt', WIDTH, 300);"
     onmouseout="return nd();"/>
Ejemplo n.º 12
0
 */
/**
 * @internal includes..
 */
$config_atkroot = "./";
include_once "atk.inc";
atksession();
atksecure();
$output = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
$output .= "\n<html>\n <head>\n";
$output .= '  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=' . atkGetCharset() . '">';
$output .= "\n  <title>" . atktext('app_title') . "</title>\n </head>\n";
atkimport("atk.menu.atkmenu");
atkimport("atk.utils.atkframeset");
$menu =& atkMenu::getMenu();
$theme =& atkinstance('atk.ui.atktheme');
$position = $menu->getPosition();
$scrolling = $menu->getScrollable() == MENU_SCROLLABLE ? FRAME_SCROLL_AUTO : FRAME_SCROLL_NO;
if (isset($ATK_VARS["atknodetype"]) && isset($ATK_VARS["atkaction"])) {
    $destination = "dispatch.php?atknodetype=" . $ATK_VARS["atknodetype"] . "&atkaction=" . $ATK_VARS["atkaction"];
    if (isset($ATK_VARS["atkselector"])) {
        $destination .= "&atkselector=" . $ATK_VARS["atkselector"];
    }
} else {
    $destination = "welcome.php";
}
$frame_top_height = $theme->getAttribute('frame_top_height');
$frame_menu_width = $theme->getAttribute('frame_menu_width');
$topframe =& new atkFrame($frame_top_height ? $frame_top_height : "75", "top", "top.php", FRAME_SCROLL_NO, true);
$mainframe =& new atkFrame("*", "main", $destination, FRAME_SCROLL_AUTO, true);
$menuframe =& new atkFrame($position == MENU_LEFT || $position == MENU_RIGHT ? $frame_menu_width ? $frame_menu_width : 190 : $menu->getHeight(), "menu", "menu.php", $scrolling);
Ejemplo n.º 13
0
/**
 * Implements the {atkthemeimg} plugin for use in templates.
 *
 * The atkthemeimg plugin retrieves an image path from the theme, while
 * respecting inheritance within the theme. In other words, if
 * a theme derives from the default theme, but does not define a
 * new version of 'someimg.jpg', then {atkthemeimg someimg.jpg} will
 * display the path to the default theme version of the same.
 *
 * Params: The name of the image to retrieve
 *
 * Example:
 * <img src="{atkthemeimg test.gif}">
 *
 * @author Ivo Jansch <*****@*****.**>
 *
 */
function smarty_function_atkthemeimg($params, &$smarty)
{
    $theme =& atkinstance("atk.ui.atktheme");
    return $theme->imgPath($params['id']);
}
Ejemplo n.º 14
0
/**
 * Implements the {atkscript} plugin for use in templates.
 *
 * The atkscript plugin registers a javascript file in the current page.
 * Useful for templates that have an associated javascript that should
 * be loaded each time the template is included.
 *
 * Params:
 * file   The path of the javascript, relative to the running scripts
 *        directory.
 * prefix The prefix for the path of the javascript file, 
 *        for example $atkroot
 *
 * Example:
 * {atkscript file="javascript/default.js"}
 *
 * @author Peter C. Verhage <*****@*****.**>
 */
function smarty_function_atkscript($params, &$smarty)
{
    $page =& atkinstance('atk.ui.atkpage');
    $page->register_script($params["prefix"] . $params["file"]);
    return "";
}
Ejemplo n.º 15
0
<?php

$config_atkroot = "./";
include_once "atk.inc";
$atkserver = atkinstance("atk.interface.atkserver");
$atkserver->run();
Ejemplo n.º 16
0
    $ui =& atkinstance("atk.ui.atkui");
    $theme =& atkTheme::getInstance();
    $page->register_style($theme->stylePath("style.css"));
    $destination = "index.php?atklogout=true";
    if (isset($ATK_VARS["atknodetype"]) && isset($ATK_VARS["atkaction"])) {
        $destination .= "&atknodetype=" . $ATK_VARS["atknodetype"] . "&atkaction=" . $ATK_VARS["atkaction"];
        if (isset($ATK_VARS["atkselector"])) {
            $destination .= "&atkselector=" . $ATK_VARS["atkselector"];
        }
    }
    $title = atktext("title_session_expired");
    $contenttpl = '<br>%s<br><br><input type="button" onclick="top.location=\'%s\';" value="%s"><br><br>';
    $content = sprintf($contenttpl, atktext("explain_session_expired"), str_replace("'", "\\'", $destination), atktext("relogin"));
    $box = $ui->renderBox(array("title" => $title, "content" => $content));
    $page->addContent($box);
    $output->output($page->render(atktext("title_session_expired"), true));
} else {
    atksecure();
    include "theme.inc";
    $lockType = atkconfig("lock_type");
    if (!empty($lockType)) {
        atklock();
    }
    // Create node
    $obj =& atkGetNode($ATK_VARS["atknodetype"]);
    $flags = array_key_exists("atkpartial", $ATK_VARS) ? HTML_PARTIAL : HTML_STRICT;
    //Handle http request
    $controller =& atkinstance("atk.atkcontroller");
    $controller->dispatch($ATK_VARS, $flags);
}
$output->outputFlush();