예제 #1
0
 /** This function will be called by MainUI for each Content BEFORE any getUserUI function is called to allow two pass Content display.
  * Two pass Content display allows such things as modyfying headers, title, creating content type that accumulate content from other pieces (like RSS feeds)
  * @return null
  */
 public function prepareGetUserUI()
 {
     if (self::isContentTypeFunctional()) {
         $this->initFeedPressReview();
         static $headerWritten = false;
         if (!$headerWritten) {
             $mainui = MainUI::getObject();
             //$mainui->appendStylesheetURL(BASE_URL_PATH . 'lib/feedpressreview/feedpressreview.css');
             $mainui->appendHtmlHeadContent("<script type='text/javascript' src='" . BASE_URL_PATH . 'lib/feedpressreview/feedpressreview.js' . "'></script>");
         }
     }
     return parent::prepareGetUserUI();
 }
예제 #2
0
$tool_html .= $pattern_language->getSponsorInfo()->__toString();
$tool_html .= "</div>";
// Body
$body_html = "<img src='images/header.gif'>\n";
$body_html .= "<h1>" . _("Participating hotspots") . "</h1>\n";
$body_html .= "<div class='pattern_language_body'>\n";
$body_html .= "<ul class='pattern_language_menu'>\n";
$body_html .= "<li>Laika : 4040 St-Laurent (coin Duluth). Métro Sherbrooke. 514-842-8088.</li>";
$body_html .= "<li>Café Supreme : 3685 St-Laurent. Métro Sherbrooke. 514-844-5975.</li>";
$body_html .= "<li>Les Folies : 701 Mont-Royal Est. Métro Mont-Royal, en face. 514-528-4343.</li>";
$body_html .= "<li>Studio XX : 338 Terasse Saint-Denis . 514-845-7934.</li>";
$body_html .= "<li>Café Tribune : 1567 Saint-Denis. Métro Berri-UQAM, sortir à Saint-Denis et traverser la rue. 514-840-0915.</li>";
$body_html .= "<li>Café l'Utopik : 552 Sainte-Catherine est. Métro Berri-UQAM, sortir à Sainte-Catherine et traverser la rue. 514-844-1139.</li>";
$body_html .= "<li>Zeke's Gallery : 3955 Saint-Laurent coin Duluth. Métro Mont-Royal. 514-288-2233.</li>";
$body_html .= "<li>Cluny's Art Bar : Fonderie Darling - 745 rue Ottawa, Vieux-Montréal . Métro Square-Victoria . 514-392-1554.</li>";
$body_html .= "<li>Café Vienne : 1446 Sainte-Catherine ouest. Métro Guy-Concordia, sortie Guy. 514-397-8779.</li>";
$body_html .= "<li>Atwater Library : 1200 Atwater. 514-935-7344. info@atwaterlibrary.ca.</li>";
$body_html .= "</ul>\n";
$body_html .= "</div>\n";
$ui = MainUI::getObject();
$ui->addContent('left_area_middle', $tool_html);
$ui->setTitle(_("Pattern Language - Hotspots list"));
$ui->addContent('main_area_middle', $body_html);
$ui->display();
/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * c-hanging-comment-ender-p: nil
 * End:
 */
예제 #3
0
 /**
  * Get the MainUI object
  * @return object The MainUI object
  */
 public static function &getObject()
 {
     if (self::$object == null) {
         self::$object = new self();
     }
     return self::$object;
 }
예제 #4
0
 private static function serverLoginForm($request, $msg = null, User $user)
 {
     $url = $request->identity;
     $name = self::DEPRECATEDgetUsernameFromOpenIdUrl($url);
     $trust_root = $request->trust_root;
     $ui = MainUI::getObject();
     $html = null;
     $action = BASE_URL_PATH . "openid/?mode=Login";
     $html .= "<form method='post' action='{$action}'>\n";
     $userData['preSelectedUser'] = $user;
     $html .= Authenticator::getLoginUI($userData);
     $html .= "</form>\n";
     $ui->addContent('main_area_top', $html);
     $ui->display();
 }
예제 #5
0
{
    if ($f == null) {
        $display->setIfEmpty($k, MainUI::HI_EMPTY, 'warning');
        return null;
    }
    if ($f['error'] == UPLOAD_ERR_INI_SIZE || $f['error'] == UPLOAD_ERR_FORM_SIZE || $f['size'] > MAX_FILE_SIZE) {
        $display->setIfEmpty($k, MainUI::HI_FILETOOBIG, 'error');
        return null;
    }
    if ($f['error'] != UPLOAD_ERR_OK || !is_uploaded_file($f['tmp_name'])) {
        $display->setIfEmpty($k, MainUI::HI_FILEERROR, 'error');
        return null;
    }
    return $f['tmp_name'];
}
$ui = new MainUI();
$submitted = KphpUI::getString("submitted", $_POST);
if ($submitted == "add") {
    if (($dbid = KphpUI::getString("addDbid", $_POST)) == "") {
        $ui->setIfEmpty("addDbid", MainUI::HI_EMPTY, "warning");
    }
    if (($mainPwd = KphpUI::getString("addMainPwd", $_POST)) == "") {
        $ui->setIfEmpty("addMainPwd", MainUI::HI_EMPTY, "warning");
    }
    $kdbxFile = checkFile("addKdbxFile", getFile("addKdbxFile"), $ui);
    $pwd1 = KphpUI::getString("addPwd1", $_POST);
    $keyfile = getFile("addFile1");
    if (!($usePwdForCK = KphpUI::getString("addUsePwdForCK", $_POST, "") != "") && $pwd1 == "" && $keyfile == null) {
        $ui->setIfEmpty("addUsePwdForCK", null, "error");
        $ui->setIfEmpty("addPwd1", MainUI::HI_NOOTHERKEY, "error");
        $ui->setIfEmpty("addFile1", MainUI::HI_ERROR, "error");
예제 #6
0
 /** This function will be called by MainUI for each Content BEFORE any getUserUI function is called to allow two pass Content display.
  * Two pass Content display allows such things as modyfying headers, title, creating content type that accumulate content from other pieces (like RSS feeds)
  * @return null
  */
 public function prepareGetUserUI()
 {
     $mainui = MainUI::getObject();
     $mainui->appendStylesheetURL(BASE_URL_PATH . 'content/Stylesheet/get_stylesheet.php?content_id=' . $this->getId());
     return parent::prepareGetUserUI();
 }
예제 #7
0
 /**
  * Constructor
  *
  * @return void
  */
 public function __construct(&$network)
 {
     $db = AbstractDb::getObject();
     $smarty = SmartyWifidog::getObject();
     // Init Smarty
     $this->_smarty =& $smarty;
     // Init network
     $this->_network = $network;
     // Init user
     $this->_currentUser = User::getCurrentUser();
     // Init MainUI class
     $this->_mainUI = MainUI::getObject();
     $network_where_sql = $network === null ? "" : "network_id = '" . $db->escapeString($this->_network->getId()) . "' AND ";
     // Query the database, sorting by node name
     $db->execSql("SELECT *, (CURRENT_TIMESTAMP-last_heartbeat_timestamp) AS since_last_heartbeat, EXTRACT(epoch FROM creation_date) as creation_date_epoch, CASE WHEN ((CURRENT_TIMESTAMP-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS is_up FROM nodes WHERE {$network_where_sql} (node_deployment_status = 'DEPLOYED' OR node_deployment_status = 'NON_WIFIDOG_NODE') ORDER BY lower(name)", $this->_nodes, false);
 }