Ejemplo n.º 1
0
/** Protects against secondary exceptions during exception display */
function exception_output_helper($html)
{
    try {
        // Load MainUI class
        $ui = MainUI::getObject();
        $ui->addContent('main_area_middle', $html);
        $ui->display();
    } catch (Exception $e) {
        echo "Notice:  A secondary Exception was thrown trying to display the Exception graphically using MainUI.  Here is the text-only output:<br/>";
        echo $html;
    }
}
Ejemplo n.º 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:
 */
Ejemplo n.º 3
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();
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 5
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();
 }
Ejemplo n.º 6
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);
 }