/** * function to get multilanguage strings * * This is actually a wrapper for ATK's atktext() method, for * use in templates. * * @author Ivo Jansch <*****@*****.**> * * Example: {atktext id="users.userinfo.description"} * {atktext id="userinfo.description" module="users"} * {atktext id="description" module="users" node="userinfo"} * */ function smarty_function_atktext($params, &$smarty) { if (!isset($params["id"])) { $params["id"] = $params[0]; } switch (substr_count($params["id"], ".")) { case 1: list($module, $id) = explode(".", $params["id"]); $str = atktext($id, $module, isset($params["node"]) ? $params["node"] : ''); break; case 2: list($module, $node, $id) = explode(".", $params["id"]); $str = atktext($id, $module, $node); break; default: $str = atktext($params["id"], atkArrayNvl($params, "module", ""), atkArrayNvl($params, "node", ""), atkArrayNvl($params, "lng", "")); } if (isset($params["filter"])) { $fn = $params["filter"]; $str = $fn($str); } // parse the rest of the params in the string atkimport("atk.utils.atkstringparser"); $parser = new atkStringParser($str); return $parser->parse($params); }
* * @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();
$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();
function ClearProcessDir($hour = '2', $minut = '0') { atkimport('atk.utils.atkfileutils'); clearstatcache(); $now = mktime(date("H") - abs((int) $hour), date("i") - abs((int) $minut), date("s"), date("m"), date("d"), date("Y")); if ($dir = @opendir($this->_process_path)) { while (($file = readdir($dir)) !== false) { if ($file != ".." && $file != ".") { if (filemtime($this->_process_path . $file) < $now) { if (!(is_dir($this->_process_path . $file) ? @atkFileUtils::rmdirRecursive($this->_process_path . '/' . $file) : @unlink($this->_process_path . $file))) { atkdebug('clsTinyButStrongOOo->ClearProcessDir: Can\'t remove directory or file : ' . $this->_process_path . $file); } } } } closedir($dir); } }
<?php $config_atkroot = "../../"; include_once $config_atkroot . './atk.inc'; atkimport('atk.utils.atkyaml'); $table = @$_SERVER['argv'][1]; if ($table == null) { die("Please specify a table name!\n"); } $table = strtolower($table); $db = atkGetDb(); $db->query("SELECT * FROM {$table}"); ob_end_clean(); for ($i = 1; $db->next_record(); $i++) { $record = $db->m_record; $yaml = atkYAML::dump(array("{$table}_{$i}" => $db->m_record)); $yaml = substr($yaml, strpos($yaml, "\n") + 1); echo $yaml; }
/** * atkFrontController plug-in. * * @author Peter C. Verhage <*****@*****.**> * @param array $params * @param Smarty $smarty * @return string result */ function smarty_function_atkfrontcontroller($params, $smarty) { atkimport('atk.front.atkfrontcontroller'); return atkFrontController::dispatchRequest($params); }
/** * Modifier to encode a Smarty/PHP variable to JSON. * * Example of usage: * {$var|@atkjson} * * @author Peter C. Verhage <*****@*****.**> */ function smarty_modifier_atkjson($data) { atkimport('atk.utils.atkjson'); return atkJSON::encode($data); }
* @version $Revision: 6301 $ * $Id: app.php 6354 2009-04-15 02:41:21Z mvdam $ */ /** * @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);
/** * This file is part of the ATK distribution on GitHub. * Detailed copyright and licensing information can be found * in the doc/COPYRIGHT and doc/LICENSE files which should be * included in the distribution. * * @package atk * @subpackage ui * * @copyright (c)2006 Ibuildings.nl BV * @license http://www.achievo.org/atk/licensing ATK Open Source License * * @version $Revision: 5442 $ * $Id$ */ atkimport("atk.utils.atkmessagequeue"); /** * Implements the {atkmessages} plugin for use in templates. * * The {atkmessages} tag does not output anything. Instead, it loads * the messages into the template variable {$atkmessages}, which is * an array of elements, each with a single message. * * <b>Example:</b> * <code> * {atkmessages} * * {foreach from=$atkmessages item=message} * {$message.message}<br> * {/foreach} * </code>
// on the month scale $graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2); $graph->scale->month->SetFontColor("white"); $graph->scale->month->SetBackgroundColor("blue"); // 0 % vertical label margin $graph->SetLabelVMarginFactor(1); $i = 0; $activity = array(); $colornode =& atkGetNode("project.mastergantt_colorconfig"); foreach ($gant as $id => $gantphase) { // Projects that extent the selected period should be cut off. if ($gantphase['startdate'] < $from) { $gantphase['startdate'] = $from; } if ($gantphase['enddate'] > $to || $gantphase['enddate'] == '') { $gantphase['enddate'] = $to; } $caption = "[" . time_format($gantphase[$plannedbooked], true) . "]"; $activity[$i] = new GanttBar($i, $gantphase['name'], $gantphase['startdate'], $gantphase['enddate'], $caption); $colorbase = $gantphase[$plannedbooked]; $color = $colornode->getColor($colorbase / 60); $activity[$i]->SetPattern(BAND_SOLID, $color); $activity[$i]->SetHeight(10); $activity[$i]->SetFillColor($color); $i++; } atkimport("module.utils.dateutil"); for ($i = 0, $_i = count($activity); $i < $_i; $i++) { $graph->Add($activity[$i]); } $graph->Stroke();
* subfolders. In advance to using this file, the config variables * whithin this file must be adjusted. * * @package achievo * * @author guido <*****@*****.**> * * @copyright (c) 2005 Ibuildings.nl BV * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2 * * @version $Revision: 2271 $ * $Id: test.php 2271 2007-06-27 06:17:18Z guido $ */ /** * @internal includes */ $config_atkroot = "./"; include_once "atk.inc"; // Start session atksession(); // Require ATK authentication if not running in text mode if (PHP_SAPI != "cli") { atksecure(); } // Set the maximum execution time of all tests together set_time_limit(atkconfig("test_maxexecutiontime")); // Include the Achievo extended webtestcase (features loginAchievo function) atkimport("test.achievowebtestcase"); // Let the atktestsuite run the requested tests in an appropriate format $suite =& atknew("atk.test.atktestsuite"); $suite->run(PHP_SAPI != "cli" ? "html" : "text", atkArrayNvl($_REQUEST, "atkmodule"));