function tx_open_printlink($content, $conf)
{
    $GLOBALS['TT']->push('open_printlink');
    $conf['type'] = $conf['type'] ? $conf['type'] : 98;
    $params = add_vars($GLOBALS['HTTP_GET_VARS']);
    if ($conf['include_post_vars']) {
        $params .= add_vars($GLOBALS['HTTP_POST_VARS']);
    }
    $templ = new t3lib_TStemplate();
    $LD = $templ->linkData($GLOBALS['TSFE']->page, '' . '', '', '', '', $params, $conf['type']);
    $uri = $LD[totalURL];
    $GLOBALS['TT']->setTSLogMessage('link to URI: ' . $uri, 0);
    $target = $conf['target'] ? ' target="' . $conf['target'] . '"' : '';
    $atags = $conf['aTagParams'] ? ' ' . $conf['aTagParams'] . ' ' : '';
    $js = $conf['noBlur'] ? '' : ' onfocus="blurLink(this);"';
    if ($conf['popup']) {
        $conf['windowname'] = $conf['windowname'] ? $conf['windowname'] : 'print';
        $conf['windowparams'] = $conf['windowparams'] ? $conf['windowparams'] : 'resizable=yes,toolbar=yes,scrollbars=yes,menubar=yes,width=500,height=500';
        $js .= ' onclick="window.open(\'' . $uri . '\',\'' . $conf['windowname'] . '\',\'' . $conf['windowparams'] . '\');"';
        $target = '';
        $uri = '#';
    }
    $GLOBALS['TT']->pull();
    return '<a href="' . $uri . '" ' . $js . $target . $atags . '>' . $content;
}
Example #2
0
function test2()
{
    $left = 1 - 10;
    $right = 5 * 3 / (10 - 7);
    $buf = "{$left} plus {$right} = " . add_vars($left, $right);
    echo "Test multiplication, division, subtraction, negative number, and order of operations.<br>\n";
    echo 'result: ' . ($buf === '-9 plus 5 = -4' ? 'pass' : 'fail') . "<br><br>\n\n";
}
Example #3
0
 function render($vars)
 {
     global $TABLE_TYPE_TO_KEY, $not_found;
     $parent_vars = $vars;
     list($stmt, $iters) = get_iter_statement($this->type, $vars);
     /*
     if (is_a($this->container, 'SearchScope')
     and  $this->container->type == $this->type
     and  $this->container->search_clause)
     $stmt .= ' and ' . $this->container->search_clause;
     */
     if ($this->search_clause) {
         $stmt .= ' and ' . $this->search_clause;
     }
     if ($this->sql_clause) {
         $stmt .= ' and ' . $this->sql_clause;
     } else {
         if ($this->order_col) {
             $stmt .= ' order by ' . $this->order_col;
         }
     }
     if (defined('T1000_DEBUG')) {
         print "<!-- foreach: {$stmt} -->";
     }
     $result_number = @$vars['result-first'] ? $vars['result-first'] : 1;
     $res = mysql_query($stmt) or fatal(mysql_error());
     if (mysql_num_rows($res) > 0) {
         $not_found = false;
         while ($cols = mysql_fetch_assoc($res)) {
             $vars = $parent_vars;
             //				foreach ($cols as $key => $value) $vars[$key] = $vars[$this->name . ".$key"] = $value;
             foreach ($iters as $iter_field => $iter_key) {
                 $vars[$iter_key] = $cols[$iter_field];
             }
             add_vars($this->type, $this->name, $vars, $vars);
             //		if (@$vars['-SUFFIX'])	-- VERY BAD KIM, GO TO JAIL YOU STUPID LITTLE BOY
             @($vars['-SUFFIX'] .= '_' . @$vars[$TABLE_TYPE_TO_KEY[$this->type]]);
             $vars['result-number'] = $result_number++;
             foreach ($this->children as $child) {
                 $child->render($vars);
                 unset($child);
             }
         }
         $not_found = false;
     } else {
         $not_found = true;
     }
 }