예제 #1
0
/**
 * 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>
 *
 * @author Patrick van der Velden <*****@*****.**>
 *
 */
function smarty_function_atkmessages($params, &$smarty)
{
    global $g_sessionManager;
    if (is_object($g_sessionManager)) {
        $msgs = atkMessageQueue::getMessages();
        $smarty->assign("atkmessages", $msgs);
        if (empty($msgs)) {
            atkdebug("No messages in atkMessageQueue");
        }
        return "";
    }
    return "";
}
예제 #2
0
 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);
     }
 }
예제 #3
0
파일: tools.php 프로젝트: rezaul101/erp32
function getFullUsername()
{
    $user =& atkGetUser();
    $username = $user["name"];
    atkdebug("tools::getFullUsername() -> " . $username);
    return $username;
}