コード例 #1
0
ファイル: poll.php プロジェクト: acohn/grinnellplans-php
function list_polls()
{
    $list = new WidgetList('polls_list', true, 'All Polls');
    $sql = "select html, poll_question_id from poll_questions where poll_question_id not in (16, 17) order by poll_question_id desc";
    $res = mysql_query($sql);
    while ($new_row = mysql_fetch_array($res)) {
        $link = new Hyperlink('poll_link', false, '?poll_question_id=' . $new_row['poll_question_id'], preg_replace('/<[^>]*>/', '', $new_row['html']));
        $list->append($link);
    }
    return $list;
}
コード例 #2
0
 /**
  * @param int $p a priority level
  * @param string $url a URL to set this autoread as current
  * @todo Give markasread as a param?
  */
 function __construct($p, $url)
 {
     parent::__construct("autoreadlev{$p}", true, "Level {$p}");
     $this->priority = $p;
     $this->contents = array();
     $this->link = new Hyperlink('set_' . $this->identifier, true, $url, $this->title);
     $this->markasread_link = new Hyperlink('markasread', false, "setpriv.php?myprivl={$p}&mark_as_read=1", 'X');
 }
コード例 #3
0
ファイル: customize.php プロジェクト: acohn/grinnellplans-php
require_once 'Plans.php';
require 'functions-main.php';
require 'syntax-classes.php';
$dbh = db_connect();
$idcookie = User::id();
// initialize page classes
$thispage = new PlansPage('Preferences', 'prefs', PLANSVNAME . ' - Preferences', 'customize.php');
if (!User::logged_in()) {
    populate_guest_page($thispage);
    $denied = new AlertText('You are not allowed to edit as a guest.', 'Access Denied');
    $thispage->append($denied);
} else {
    populate_page($thispage, $dbh, $idcookie);
    $heading = new HeadingText('Preferences', 1);
    $thispage->append($heading);
    $preflist = new WidgetList('preflist', "Preferences");
    // make the list of preference pages
    $arr = array('Change Password' => "changepassword.php", 'Change Name' => "changename.php", 'Change Permanent Email' => 'changeemail.php', 'Guest Readable' => "webview.php", "Blocking" => 'blocks.php', 'Customize' => '', 'Interfaces' => "interfaces.php", 'Styles' => "styles.php", 'Edit Text Box Size' => "textbox.php", 'Optional Links' => "links.php");
    foreach ($arr as $name => $ref) {
        if (strtolower($name) != 'customize') {
            $alink = new Hyperlink('preflink', false, $ref, $name);
            $preflist->append($alink);
        } else {
            $aheading = new HeadingText('Customize', 2);
            $preflist->append($aheading);
        }
    }
    $thispage->append($preflist);
}
//if is a valid user
interface_disp_page($thispage);