コード例 #1
0
ファイル: layout.php プロジェクト: marcosptf/web-gtk
function commonHeader($title = false, $padding = true)
{
    global $SIDEBAR_DATA;
    ob_start();
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
 <title>PHP-GTK<?php 
    if ($title) {
        echo ' : ' . $title;
    }
    ?>
</title>
 <link rel="stylesheet" type="text/css" href="/style.css" />
 <link rel="stylesheet" type="text/css" href="/style-highlight.css" />
 <link rel="alternate" type="application/rss+xml" title="PHP-GTK News" href="http://gtk.php.net/news.rss"/>
 <link rel="shortcut icon" href="/gifs/favicon.ico" />
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#000099" alink="#0000FF" vlink="#000099">
 <a name="TOP"></a>
 <table border="0" cellspacing="0" cellpadding="0" width="100%" style="height:48px;">
  <tr bgcolor="#0099CC">
   <td align="left" rowspan="2">
    <?php 
    print_link('/', make_image('php-gtk.gif', 'PHP-GTK', false, 'vspace="2" hspace="2"'));
    ?>
<br />
   </td>
   <td align="right" valign="top" style="white-space: nowrap">
    <font color="#FFFFFF">
     <b><?php 
    echo strftime("%A, %B %d, %Y");
    ?>
</b>&nbsp;<br />
    </font>
   </td>
  </tr>
  <tr bgcolor="#0099CC">
   <td align="right" valign="bottom" style="white-space: nowrap">
    <?php 
    print_link('/download.php', 'download', false, 'class="menuBlack"');
    echo delim();
    print_link('/docs.php', 'documentation', false, 'class="menuBlack"');
    echo delim();
    print_link('/apps/', 'applications', false, 'class="menuBlack"');
    echo delim();
    print_link('/faq.php', 'faq', false, 'class="menuBlack"');
    echo delim();
    print_link('/changelog.php', 'changelog', false, 'class="menuBlack"');
    echo delim();
    print_link('/resources.php', 'resources', false, 'class="menuBlack"');
    if (isset($_COOKIE['PHP-GTK'])) {
        echo delim();
        print_link('/admin-logout.php', 'logout', false, 'class="menuBlack"');
    }
    ?>
&nbsp;<br />
    <?php 
    spacer(2, 2);
    ?>
<br />
   </td>
  </tr>
  <tr bgcolor="#000033"><td colspan="2"><?php 
    spacer(1, 1);
    ?>
<br /></td></tr>
  <tr bgcolor="#006699">
   <td align="right" valign="top" colspan="2" style="white-space: nowrap">
    <form method="post" action="/search.php" style="display:inline">
      <font color="#FFFFFF">
       <small>search for</small>
       <input class="small" type="text" name="pattern" value="<?php 
    if (isset($_GET['prevsearch'])) {
        echo htmlentities($_GET['prevsearch']);
    }
    ?>
" size="30" />
       <small>in the</small>
       <select name="show" class="small">
<?php 
    $options = array('manual' => 'PHP-GTK 2 manual', 'manual1' => 'PHP-GTK 1 manual', 'whole-site' => 'whole site', 'php-gtk-general-list' => 'general mailing list', 'php-gtk-dev-list' => 'development mailing list', 'php-gtk-doc-list' => 'documentation mailing list');
    $uris = explode('/', $_SERVER['REQUEST_URI']);
    $dir = $uris[1];
    foreach ($options as $value => $title) {
        $sel = $value == substr($dir, 0, strlen($value)) ? ' selected="selected"' : '';
        echo '<option value="' . $value . '"' . $sel . '>' . $title . '</option>' . "\n";
    }
    ?>
       </select>
      <?php 
    echo make_submit('small_submit_white.gif', 'search', 'bottom');
    ?>
&nbsp;<br />
     </font>
    </form>
   </td>
  </tr>
  <tr bgcolor="#000033"><td colspan="2"><?php 
    spacer(1, 1);
    ?>
<br /></td></tr>
 </table>

 <table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr valign="top">
   <?php 
    if (isset($SIDEBAR_DATA)) {
        ?>
   <td width="200" bgcolor="#F0F0F0">
    <table width="100%" cellpadding="4" cellspacing="0">
     <tr valign="top">
      <td class="sidebar">
       <?php 
        echo $SIDEBAR_DATA;
        ?>
      </td>
     </tr>
    </table>
   </td>
   <td bgcolor="#CCCCCC" style="background-image:url(/gifs/checkerboard.gif)"><?php 
        spacer(1, 1);
        ?>
<br /></td>
    <?php 
    }
    ?>
   <td>
    <table width="100%" cellpadding="<?php 
    if ($padding) {
        print "10";
    } else {
        print "0";
    }
    ?>
" cellspacing="0">
     <tr>
      <td valign="top">
<?php 
}
コード例 #2
0
    function main($content = '', $conf = '')
    {
        $this->conf = $conf;
        //debug($_POST,"post");
        //debug($_GET,"get");
        //debug($GLOBALS,"globals");
        //init
        $this->initialize();
        //tnl user ermitteln und ggf anlegen
        $this->gettnluser();
        //abonnierte nls ermitteln
        $this->getabonls();
        if (isset($_POST[$this->prefixId])) {
            $this->checkpost();
            $this->getabonls();
        }
        $this->gettnluser();
        $webuser = $_SESSION["webuser"];
        $base_dir = dirname(__FILE__);
        require_once "xox.newsletter.conf.php";
        //User GRUPPEN bestimmen
        $uflag[] = 0;
        $uflag[] = $checkbox_options['uflags']['Normale'];
        //Normale 1
        $ufla = $checkbox_options['uflags']['Normale'];
        if (isset($webuser['bonAPO']) && $webuser['bonAPO'] == 1) {
            $uflag[] = $checkbox_options['uflags']['BonAPO'];
            //8
            $ufla = $checkbox_options['uflags']['BonAPO'];
        }
        if (isset($webuser['bayUNI']) && $webuser['bayUNI'] == 1) {
            $uflag[] = $checkbox_options['uflags']['BayUNI'];
            //4
            $ufla = $checkbox_options['uflags']['BayUNI'];
        }
        if (isset($partner["status"]) && ($partner["status"] == "TOP" || $partner["status"] == "AD")) {
            $uflag[] = $checkbox_options['uflags']['Experts'];
            //2
            $ufla = $checkbox_options['uflags']['Experts'];
            //2
        }
        //echo $uflag.":".$checkbox_options['uflags']['Normale']; //Normale;
        $uflagstr = implode(",", $uflag);
        //alle anzuzeigenden Newsletter ermitteln
        //$sql="SELECT * FROM newsletter WHERE domain_id=".INIBASTNL_DOMAIN_ID." AND active='1' AND (uflags IN (".$uflagstr.") OR uflags=".$ufla.")";
        $sql = "SELECT * FROM newsletter WHERE domain_id=" . INIBASTNL_DOMAIN_ID . " AND active='1' AND (uflags='0' OR uflags='" . $ufla . "') ORDER BY sort,created";
        //echo $sql;
        mysql_select_db($this->tnl_db, $this->contnl);
        $result = mysql_query($sql, $this->contnl);
        $content = '<br /><form action="?id=' . $this->cObj->data['pid'] . '" name="nlform" method="POST">
			<input type="hidden" name="no_cache" value="1">';
        $content .= '<div class="tnllist">' . "\n";
        $content .= '<table border=0 width="400px" cellspacing="0" cellspacing="0" style="margin:0px;">';
        ///$content .= '<tr><td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class="trennerH">&nbsp;</td></tr></table></td></tr>';
        /*
        			///$content .= 	'<tr><td colspan="2">'.INIBASTNL_TEXT_NL_INTRO.'</td></tr>'."\n";
        			$content.= '<tr  valign="bottom"><td align="right" colspan="2" ><br />';
        
        			$content.= make_submit(htmlspecialchars($this->pi_getLL("submit_button_label")),'cmd_save');
        
        			//$this->content.= '<br /><br />';//</td><td align="right" >';
        
        			$content.= '<div style="position:relative; top:-20px; left: -270px;" >'.make_submit(htmlspecialchars($this->pi_getLL("close_button_label")),'cmd_back').'</div>';
        
        			$content.= "</td></tr>\n";
        */
        $i = 0;
        while ($row = mysql_fetch_array($result)) {
            $style = $i % 2 ? ' style="background:' . INIBASTNL_COLOR_NL_LIST . ';"' : '';
            $content .= '<tr' . $style . '><td width="25px">';
            $content .= '<input type="checkbox" name="' . $this->prefixId . '[nl][' . $row['id'] . ']" value="' . $row['id'] . '" ' . (isset($this->abonls[$row['id']]) ? 'checked' : '') . '>';
            $content .= '</td><td>';
            $content .= '<b>' . $row['name'] . '</b>';
            $content .= '</td></tr>';
            $content .= '<tr' . $style . '><td width="25px">&nbsp;</td>';
            $content .= '<td>' . ($row['description'] ? $row['description'] : '&nbsp;') . '</td></tr>';
            $content .= '<tr' . $style . '><td width="25px">&nbsp;</td>';
            $content .= '<td>&nbsp;</td></tr>';
            $i++;
        }
        ///$content .= '<tr><td colspan="2"><b>'.INIBASTNL_TEXT_CONFIG_TITLE.'</b></td></tr>';
        $content .= '<tr><td colspan="2"><br /><br />' . INIBASTNL_TEXT_CONFIG_INTRO . '</td></tr>';
        $content .= '<tr><td colspan="2" align="right">';
        $content .= '<table width="100%" align="right" border=0><tr valign="top"><td align="center" valign="top" width="25"><input type="radio" name="' . $this->prefixId . '[config]" value="html" ' . ($this->tnluser['config'] == 'html' ? 'checked' : '') . ' onclick="document.nlform.submit();" /> </td> <td align="left" valign="top"><b>HTML-Mail</b> </td>';
        $content .= '<td width="25" align="center" valign="top"><input type="radio" name="' . $this->prefixId . '[config]" value="text" ' . ($this->tnluser['config'] == 'text' ? 'checked' : '') . ' onclick="document.nlform.submit();" /> </td> <td align="left" ><b>Text-Mail</b>';
        $content .= '</td></tr></table><br /><br /><br /></td></tr>';
        $content .= '<tr  valign="bottom"><td align="right" colspan="2" ><br />';
        $content .= make_submit(htmlspecialchars("Save"), 'cmd_save');
        //$this->content.= '<br /><br />';//</td><td align="right" >';
        //$content.= '<div style="position:relative; top:-20px; left: -270px;" >'.bayas_make_submit(htmlspecialchars($this->pi_getLL("close_button_label")),'cmd_back').'</div>';
        $content .= "</td></tr>\n";
        $content .= '</table></div>';
        $content .= '	</form>';
        //<p>You can click here to '.$this->pi_linkToPage("get to this page again",$GLOBALS["TSFE"]->id).'</p>
        return $content;
    }