コード例 #1
0
ファイル: OnpubWidgetFooter.php プロジェクト: onpubcom/onpub
 public function display()
 {
     en('</div>');
     en('</div>');
     en('</div>');
     en('</div>');
     en('<div id="onpub-footer">');
     en('<div id="onpub-footer-content">');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-3-4">');
     en('<p class="onpub-copyright">Onpub ' . ONPUBAPI_VERSION . '. &copy; ' . date('Y') . ' <a class="onpub-footer-nav" href="http://onpub.com/" target="_blank">Onpub.com</a> | <a class="onpub-footer-nav" href="http://onpub.com/index.php?s=8" target="_blank">User Guide</a></p>');
     en('</div>');
     en('<div class="yui3-u-1-4" style="text-align: right;">');
     en('<span class="onpub-login"><a class="onpub-footer-nav" href="index.php?onpub=Logout">Logout</a></span>');
     en('</div>');
     en('</div>');
     en('</div>');
     en('</div>');
     if (file_exists(ONPUBGUI_YUI_DIRECTORY)) {
         en('<script type="text/javascript" src="../bower_components/yui3/build/yui/yui-min.js"></script>');
     } else {
         en('<script type="text/javascript" src="http://yui.yahooapis.com/combo?' . ONPUBGUI_YUI_VERSION . '/build/yui/yui-min.js"></script>');
     }
     en('<script type="text/javascript" src="js/onpub.js"></script>');
     en('</body>');
     en('</html>');
 }
コード例 #2
0
 function display()
 {
     en('<h3 class="onpub-field-header">Website</h3>');
     en('<p>');
     if (sizeof($this->websites)) {
         if (sizeof($this->websites) == 1) {
             en('<select name="websiteID" size="1">');
             en('<option value="' . $this->websites[0]->ID . '" selected="selected">' . strip_tags($this->websites[0]->name) . '</option>');
             en('</select>');
         } else {
             en('<select name="websiteID" size="1">');
             en('<option value="">Select a website..</option>');
             for ($i = 0; $i < sizeof($this->websites); $i++) {
                 if ($this->websites[$i]->ID == $this->websiteID) {
                     en('<option value="' . $this->websites[$i]->ID . '" selected="selected">' . strip_tags($this->websites[$i]->name) . '</option>');
                 } else {
                     en('<option value="' . $this->websites[$i]->ID . '">' . strip_tags($this->websites[$i]->name) . '</option>');
                 }
             }
             if ($this->websiteID === "") {
                 en('</select> <img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'exclamation.png" align="top" alt="Required field" title="Required field">');
             } else {
                 en('</select>');
             }
         }
     } else {
         if ($this->websiteID === "") {
             en('<span class="onpub-error">There are 0 websites in the database.</span> <a href="index.php?onpub=NewWebsite">New Website</a>.');
         } else {
             en('There are 0 websites in the database. <a href="index.php?onpub=NewWebsite">New Website</a>.');
         }
     }
     en('</p>');
 }
コード例 #3
0
ファイル: OnpubWidgetImages.php プロジェクト: onpubcom/onpub
 function display()
 {
     $image = NULL;
     if (sizeof($this->images)) {
         en('<h3 class="onpub-field-header">' . $this->heading . '</h3>');
         en('<p>');
         en('<small>Mouse-over an image name below for a live preview.</small>', 1, 1);
         en('<span id="widgetimagepreview">');
         en('<select id="widgetimages" name="imageID" size="10">');
         if ($this->imageID) {
             en('<option value="">None</option>');
         } else {
             en('<option value="" selected="selected">None</option>');
         }
         for ($i = 0; $i < sizeof($this->images); $i++) {
             if ($this->images[$i]->ID == $this->imageID) {
                 $image = $this->images[$i];
                 en('<option value="' . $this->images[$i]->ID . '" selected="selected">' . strip_tags($this->images[$i]->fileName) . '</option>');
             } else {
                 en('<option value="' . $this->images[$i]->ID . '">' . strip_tags($this->images[$i]->fileName) . '</option>');
             }
         }
         en('</select>');
         en('</span>');
         en('</p>');
         en('<script type="text/javascript">var onpubThumbURLs = [];');
         foreach ($this->images as $i) {
             en('onpubThumbURLs.push(\'' . OnpubImages::getThumbURL('src=' . urlencode($i->getFullPath()) . '&h=80&f=png') . '\');');
         }
         en('</script>');
     }
 }
コード例 #4
0
ファイル: onpubapi.php プロジェクト: onpubcom/onpubapi
function br($b = 1, $n = 1)
{
    $br = '';
    while ($b > 0) {
        $br .= '<br>';
        $b--;
    }
    en($br, $n);
}
コード例 #5
0
ファイル: OnpubNewSection.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $owebsites = new OnpubWebsites($this->pdo);
     $osections = new OnpubSections($this->pdo);
     $queryOptions = new OnpubQueryOptions();
     $queryOptions->orderBy = "name";
     $queryOptions->order = "ASC";
     try {
         $websites = $owebsites->select($queryOptions);
     } catch (PDOException $e) {
         throw $e;
     }
     $widget = new OnpubWidgetHeader("New Section", ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="post" enctype="multipart/form-data">');
     en('<div>');
     if ($this->osection->name === NULL) {
         en('<h3 class="onpub-field-header">Name</h3><p><input type="text" maxlength="255" size="' . 30 . '" name="name" value="' . htmlentities($this->osection->name) . '"> <img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'exclamation.png" align="top" alt="Required field" title="Required field"></p>');
     } else {
         en('<h3 class="onpub-field-header">Name</h3><p><input type="text" maxlength="255" size="' . 30 . '" name="name" value="' . htmlentities($this->osection->name) . '"></p>');
     }
     if ($this->osection->parentID) {
         $sectionIDs = array();
         $sectionIDs[] = $this->osection->parentID;
     } else {
         $sectionIDs = NULL;
     }
     $widget = new OnpubWidgetSections();
     $widget->sectionIDs = $sectionIDs;
     $widget->websites = $websites;
     $widget->osections = $osections;
     $widget->heading = "Parent Section";
     $widget->multiple = FALSE;
     $widget->fieldName = "sectionID";
     $widget->parentID = $this->osection->parentID;
     $widget->display();
     $widget = new OnpubWidgetWebsites($this->osection->websiteID, $websites, "section");
     $widget->display();
     if (sizeof($websites)) {
         if ($this->visible) {
             en('<h3 class="onpub-field-header">Visibility</h3>');
             en('<p><input type="checkbox" id="id_visible" name="visible" value="1" checked="checked"> <label for="id_visible">De-select to hide this section from the Frontend.</label></p>');
         } else {
             en('<h3 class="onpub-field-header">Visibility</h3>');
             en('<p><input type="checkbox" id="id_visible" name="visible" value="1"> <label for="id_visible">Select to show this section on the Frontend.</label></p>');
         }
     }
     en('<input type="submit" value="Save">');
     en('<input type="hidden" name="onpub" value="NewSectionProcess">');
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #6
0
ファイル: OnpubMoveArticles.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $oarticles = new OnpubArticles($this->pdo);
     $osections = new OnpubSections($this->pdo);
     $owebsites = new OnpubWebsites($this->pdo);
     $articles = array();
     $websites = array();
     try {
         if (is_array($this->articleIDs)) {
             $queryOptions = new OnpubQueryOptions();
             $queryOptions->includeContent = FALSE;
             for ($i = 0; $i < sizeof($this->articleIDs); $i++) {
                 $articles[] = $oarticles->get($this->articleIDs[$i], $queryOptions);
             }
         }
         $queryOptions = new OnpubQueryOptions();
         $queryOptions->orderBy = "name";
         $queryOptions->order = "ASC";
         $websites = $owebsites->select($queryOptions);
     } catch (PDOException $e) {
         throw $e;
     }
     $widget = new OnpubWidgetHeader("Move Articles", ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="post">');
     en('<div>');
     if (sizeof($articles)) {
         en('<h3>Selected Articles</h3>');
         en('<ul>');
         for ($i = 0; $i < sizeof($articles); $i++) {
             en('<li><a href="index.php?onpub=EditArticle&amp;articleID=' . $articles[$i]->ID . '" title="Edit">' . $articles[$i]->title . '</a></li>');
             en('<input type="hidden" name="articleIDs[]" value="' . $articles[$i]->ID . '">');
         }
         en('</ul>');
         $widget = new OnpubWidgetSections();
         $widget->websites = $websites;
         $widget->osections = $osections;
         $widget->display();
         en('<input type="submit" value="Move">');
     } else {
         en('<span class="onpub-error">No articles were selected to move.</span>');
     }
     en('<input type="hidden" name="onpub" value="ArticleMoveProcess">');
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #7
0
ファイル: OnpubWidgetSearch.php プロジェクト: onpubcom/onpub
 public function display()
 {
     if ($this->fullTextSearch == "NA") {
         if ($this->keywords) {
             if ($this->totalArticles == 1) {
                 en('<input type="submit" value="X" onclick="clearSearchField();"> <input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value="' . htmlentities($this->keywords) . '"> <input type="submit" value="Search">');
             } else {
                 en('<input type="submit" value="X" onclick="clearSearchField();"> <input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value="' . htmlentities($this->keywords) . '"> <input type="submit" value="Search">');
             }
         } else {
             if ($this->totalArticles == 1) {
                 en('<input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value=""> <input type="submit" value="Search">');
             } else {
                 en('<input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value=""> <input type="submit" value="Search">');
             }
         }
     } else {
         if ($this->fullTextSearch) {
             if ($this->keywords) {
                 if ($this->totalArticles == 1) {
                     en('<input type="submit" value="X" onclick="clearSearchField();"> <input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value="' . htmlentities($this->keywords) . '"> <input type="submit" value="Search"> <input type="checkbox" name="fullTextSearch" id="id_fullTextSearch" value="1" checked="checked"><label for="id_fullTextSearch"> Fulltext</label>');
                 } else {
                     en('<input type="submit" value="X" onclick="clearSearchField();"> <input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value="' . htmlentities($this->keywords) . '"> <input type="submit" value="Search"> <input type="checkbox" name="fullTextSearch" id="id_fullTextSearch" value="1" checked="checked"><label for="id_fullTextSearch"> Fulltext</label>');
                 }
             } else {
                 if ($this->totalArticles == 1) {
                     en('<input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value=""> <input type="submit" value="Search"> <input type="checkbox" name="fullTextSearch" id="id_fullTextSearch" value="1" checked="checked"><label for="id_fullTextSearch"> Fulltext</label>');
                 } else {
                     en('<input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value=""> <input type="submit" value="Search"> <input type="checkbox" name="fullTextSearch" id="id_fullTextSearch" value="1" checked="checked"><label for="id_fullTextSearch"> Fulltext</label>');
                 }
             }
         } else {
             if ($this->keywords) {
                 if ($this->totalArticles == 1) {
                     en('<input type="submit" value="X" onclick="clearSearchField();"> <input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value="' . htmlentities($this->keywords) . '"> <input type="submit" value="Search"> <input type="checkbox" name="fullTextSearch" id="id_fullTextSearch" value="1"><label for="id_fullTextSearch"> Fulltext</label>');
                 } else {
                     en('<input type="submit" value="X" onclick="clearSearchField();"> <input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value="' . htmlentities($this->keywords) . '"> <input type="submit" value="Search"> <input type="checkbox" name="fullTextSearch" id="id_fullTextSearch" value="1"><label for="id_fullTextSearch"> Fulltext</label>');
                 }
             } else {
                 if ($this->totalArticles == 1) {
                     en('<input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value=""> <input type="submit" value="Search"> <input type="checkbox" name="fullTextSearch" id="id_fullTextSearch" value="1"><label for="id_fullTextSearch"> Fulltext</label>');
                 } else {
                     en('<input type="text" accesskey="s" maxlength="255" size="' . 30 . '" name="keywords" value=""> <input type="submit" value="Search"> <input type="checkbox" name="fullTextSearch" id="id_fullTextSearch" value="1"><label for="id_fullTextSearch"> Fulltext</label>');
                 }
             }
         }
     }
 }
コード例 #8
0
ファイル: OnpubNewWebsite.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $widget = new OnpubWidgetHeader("New Website", ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="post" enctype="multipart/form-data">');
     en('<div>');
     if ($this->owebsite->name === NULL) {
         en('<h3 class="onpub-field-header">Name</h3><p><input type="text" maxlength="255" size="' . 30 . '" name="name" value="' . htmlentities($this->owebsite->name) . '"> <img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'exclamation.png" align="top" alt="Required field" title="Required field"></p>');
     } else {
         en('<h3 class="onpub-field-header">Name</h3><p><input type="text" maxlength="255" size="' . 30 . '" name="name" value=""></p>');
     }
     en('<input type="submit" value="Save">');
     en('<input type="hidden" name="onpub" value="NewWebsiteProcess">');
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #9
0
 public function display()
 {
     $owebsites = new OnpubWebsites($this->pdo);
     en('<h3 class="onpub-field-header">Display sections in..</h3>');
     en('<p>');
     en('<select name="websiteID"  onchange="document.forms[0].submit();">');
     en('<option value="">All Websites</option>');
     $queryOptions = new OnpubQueryOptions();
     $queryOptions->orderBy = "name";
     $queryOptions->order = "ASC";
     $websites = $owebsites->select($queryOptions);
     for ($i = 0; $i < sizeof($websites); $i++) {
         if ($websites[$i]->ID == $this->websiteID) {
             en('<option value="' . $websites[$i]->ID . '" selected="selected">' . strip_tags($websites[$i]->name) . '</option>');
         } else {
             en('<option value="' . $websites[$i]->ID . '">' . strip_tags($websites[$i]->name) . '</option>');
         }
     }
     en('</select>');
     en('</p>');
 }
コード例 #10
0
 function display()
 {
     $osamaps = new OnpubSAMaps($this->pdo);
     $oarticles = new OnpubArticles($this->pdo);
     $articles = array();
     en('<h3 class="onpub-field-header">Visible Articles</h3>');
     en('<p>');
     en('<small>These articles will be displayed by the Frontend in the same order as listed below.</small>', 1, 1);
     en('<select name="articleIDs[]" size="10" multiple="multiple" id="articles">');
     $queryOptions = new OnpubQueryOptions();
     $queryOptions->orderBy = "ID";
     $queryOptions->order = "ASC";
     $samaps = $osamaps->select($queryOptions, $this->osection->ID);
     if (sizeof($samaps)) {
         for ($i = 0; $i < sizeof($samaps); $i++) {
             $article = $oarticles->get($samaps[$i]->articleID);
             en('<option value="' . $article->ID . '">' . strip_tags($article->title) . '</option>');
             $articles[] = $article;
         }
     } else {
         en('<option value="">None</option>');
     }
     en('</select>');
     en('</p>');
     en('<p><input type="button" value="Move Up" id="moveUp"> <input type="button" value="Move Down" id="moveDown"> <input type="button" value="Sort By Date" id="sortByDate"> <input type="button" value="Hide" id="hide"></p>');
     // Output articles as JS objects to enable sorting articles list.
     en('<script type="text/javascript">');
     en('var onpub_articles = [');
     for ($i = 0; $i < sizeof($articles); $i++) {
         $created = $articles[$i]->getCreated();
         en('{ID: ' . $articles[$i]->ID . ', title: "' . str_replace('"', '\\"', strip_tags($articles[$i]->title)) . '", created: new Date(' . $created->format("Y") . ', ' . ($created->format("n") - 1) . ', ' . $created->format("j") . ', ' . $created->format("G") . ', ' . $created->format("i") . ', ' . $created->format("s") . ')}', 0);
         if ($i + 1 < sizeof($articles)) {
             en(',');
         }
     }
     en('];');
     en('</script>');
 }
コード例 #11
0
 public function display()
 {
     if ($this->header) {
         $widget = new OnpubWidgetHeader("PDO Exception");
         $widget->display();
     }
     en('<h3 class="onpub-field-header">Error Message</h3><p class="onpub-error">' . $this->exception->getMessage() . '</p>');
     en('<h3 class="onpub-field-header">Error Code</h3><p>' . $this->exception->getCode() . '</p>');
     $sqlstate = $this->exception->errorInfo[0];
     en('<h3 class="onpub-field-header">SQLSTATE Code</h3><p>' . $sqlstate . '</p>');
     en('<h3 class="onpub-field-header">Trace 0</h3><p>File: ' . $this->exception->getFile() . '. Line: ' . $this->exception->getLine() . '.</p>');
     $trace = $this->exception->getTrace();
     for ($i = 0; $i < sizeof($trace); $i++) {
         en('<h3 class="onpub-field-header">Trace ' . ($i + 1) . '</h3>', 0);
         en('<p>Method: ' . $trace[$i]['class'] . $trace[$i]['type'] . $trace[$i]['function'] . '().');
         en('File: ' . $trace[$i]['file'] . '.', 0);
         en(' Line: ' . $trace[$i]['line'] . '.</p>', 0);
     }
     if ($this->footer) {
         $widget = new OnpubWidgetFooter();
         $widget->display();
     }
 }
コード例 #12
0
ファイル: OnpubWidgetStats.php プロジェクト: onpubcom/onpub
 public function display()
 {
     if ($this->keywords) {
         if ($this->totalArticles == 1) {
             en('<span class="onpub-field-header">' . $this->totalArticles . ' ' . $this->listType . ' Found</span>');
         } else {
             en('<span class="onpub-field-header">' . $this->totalArticles . ' ' . $this->listType . 's Found</span>');
         }
     } else {
         if ($this->id) {
             if ($this->totalArticles == 1) {
                 en('<span class="onpub-field-header">' . $this->totalArticles . ' ' . $this->listType . ' in ' . $this->listTypeParent . '</span>');
             } else {
                 en('<span class="onpub-field-header">' . $this->totalArticles . ' ' . $this->listType . 's in ' . $this->listTypeParent . '</span>');
             }
         } else {
             if ($this->totalArticles == 1) {
                 en('<span class="onpub-field-header">' . $this->totalArticles . ' ' . $this->listType . ' in Total</span>');
             } else {
                 en('<span class="onpub-field-header">' . $this->totalArticles . ' ' . $this->listType . 's in Total</span>');
             }
         }
     }
 }
コード例 #13
0
ファイル: OnpubWidgetHeader.php プロジェクト: onpubcom/onpub
 function display()
 {
     en('<!DOCTYPE html>');
     en('<html>');
     en('<head>');
     en('<meta name="viewport" content="width=device-width; initial-scale=1.0">');
     en('<meta charset="ISO-8859-1">');
     en('<title>' . strip_tags("Onpub (on " . $_SERVER['SERVER_NAME'] . ") - " . $this->title) . '</title>');
     /*
     if (file_exists(ONPUBGUI_YUI_DIRECTORY)) {
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'cssnormalize/cssnormalize-min.css">');
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'cssfonts/cssfonts-min.css">');
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'cssgrids/cssgrids-min.css">');
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'node-menunav/assets/skins/sam/node-menunav.css">');
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'widget-base/assets/skins/sam/widget-base.css">');
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'widget-stack/assets/skins/sam/widget-stack.css">');
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'overlay/assets/skins/sam/overlay.css">');
     }
     else {
       en('<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?' .
          ONPUBGUI_YUI_VERSION . '/build/cssnormalize/cssnormalize-min.css&' . ONPUBGUI_YUI_VERSION .
          '/build/cssfonts/cssfonts-min.css&' . ONPUBGUI_YUI_VERSION .
          '/build/cssgrids/cssgrids-min.css&' . ONPUBGUI_YUI_VERSION .
          '/build/node-menunav/assets/skins/sam/node-menunav.css&' . ONPUBGUI_YUI_VERSION .
          '/build/widget-base/assets/skins/sam/widget-base.css&' . ONPUBGUI_YUI_VERSION .
          '/build/widget-stack/assets/skins/sam/widget-stack.css&' . ONPUBGUI_YUI_VERSION .
          '/build/overlay/assets/skins/sam/overlay.css">');
     }
     */
     en('<link rel="stylesheet" type="text/css" href="css/yui-combo-min.css">');
     en('<link href="//fonts.googleapis.com/css?family=Roboto:400,400italic,700,700italic" rel="stylesheet" type="text/css">');
     en('<link rel="stylesheet" type="text/css" href="css/onpub.css">');
     en('<link rel="stylesheet" type="text/css" href="css/onpub-menu.css">');
     en('<script type="text/javascript" src="' . ONPUBGUI_CKEDITOR_DIRECTORY . 'ckeditor.js"></script>');
     en('<script type="text/javascript">');
     en('document.documentElement.className = "yui3-loading";');
     if (file_exists(ONPUBGUI_YUI_DIRECTORY)) {
         en('var onpub_dir_yui = "../bower_components/yui3/build/";');
     } else {
         en('var onpub_dir_yui = null;');
     }
     en('var onpub_yui_version = "' . ONPUBGUI_YUI_VERSION . '";');
     en('</script>');
     en('</head>');
     en('<body class="yui3-skin-sam">');
     en('<div id="onpub-header">');
     en('<div id="onpub-logo">');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-4">');
     en('<a href="index.php"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'onpub-small.png" width="150" height="60" alt="Onpub" title="Onpub" border="0"></a>', 1);
     en('</div>');
     en('<div class="yui3-u-3-4">');
     en('<div id="onpub-menubar" class="yui3-menu yui3-menu-horizontal yui3-menubuttonnav" style="float: right; margin-top: 2.25em;">');
     en('<div class="yui3-menu-content">');
     en('<ul>');
     if ($this->dbstatus == ONPUBAPI_SCHEMA_VERSION) {
         if ($this->pdo) {
             $oarticles = new OnpubArticles($this->pdo);
         } else {
             $oarticles = null;
         }
         en('<li>');
         en('<a class="yui3-menu-label" href="#new"><em>New</em></a>');
         en('<div id="new" class="yui3-menu">');
         en('<div class="yui3-menu-content">');
         en('<ul>');
         en('<li class="yui3-menuitem"><a class="yui3-menuitem-content" href="index.php?onpub=NewArticle">Article</a></li>');
         en('<li class="yui3-menuitem"><a class="yui3-menuitem-content" href="index.php?onpub=NewSection">Section</a></li>');
         en('<li class="yui3-menuitem"><a class="yui3-menuitem-content" href="index.php?onpub=NewWebsite">Website</a></li>');
         en('</ul>');
         en('</div>');
         en('</div>');
         en('</li>');
         if ($oarticles) {
             $queryOptions = new OnpubQueryOptions();
             $queryOptions->includeContent = FALSE;
             $queryOptions->orderBy = "modified";
             $queryOptions->order = "DESC";
             $queryOptions->setPage(1, ONPUBGUI_PDO_ROW_LIMIT);
             try {
                 $articles = $oarticles->select($queryOptions);
             } catch (PDOException $e) {
                 $articles = null;
             }
         } else {
             $articles = null;
         }
         if ($articles) {
             en('<li>');
             en('<a class="yui3-menu-label" href="index.php?onpub=EditArticles"><em>Articles</em></a>');
             en('<div id="edit" class="yui3-menu">');
             en('<div class="yui3-menu-content">');
             en('<ul>');
             foreach ($articles as $a) {
                 en('<li class="yui3-menuitem"><a class="yui3-menuitem-content" href="index.php?onpub=EditArticle&articleID=' . $a->ID . '">' . $a->title . '</a></li>');
             }
             en('<li class="yui3-menuitem"><a class="yui3-menuitem-content" href="index.php?onpub=EditArticles">All Articles..</a></li>');
             en('</ul>');
             en('</div>');
             en('</div>');
             en('</li>');
         } else {
             en('<li class="yui3-menuitem">');
             en('<a class="yui3-menuitem-content" href="index.php?onpub=EditArticles">Articles</a>');
             en('</li>');
         }
         en('<li class="yui3-menuitem">');
         en('<a class="yui3-menuitem-content" href="index.php?onpub=EditImages">Images</a>');
         en('</li>');
         en('<li class="yui3-menuitem">');
         en('<a class="yui3-menuitem-content" href="index.php?onpub=EditSections">Sections</a>');
         en('</li>');
         en('<li class="yui3-menuitem">');
         en('<a class="yui3-menuitem-content" href="index.php?onpub=EditWebsites">Websites</a>');
         en('</li>');
         en('<li>');
         en('<a class="yui3-menu-label" href="#upload"><em>Upload</em></a>');
         en('<div id="upload" class="yui3-menu">');
         en('<div class="yui3-menu-content">');
         en('<ul>');
         en('<li class="yui3-menuitem"><a class="yui3-menuitem-content" href="index.php?onpub=UploadImages">Images</a></li>');
         en('</ul>');
         en('</div>');
         en('</div>');
         en('</li>');
     }
     en('</ul>');
     en('</div>');
     en('</div>');
     en('</div>');
     en('</div>');
     en('</div>');
     en('</div>');
     en('<div id="onpub-page">');
     en('<div id="onpub-body">');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1">');
     if ($this->title) {
         en('<h1 style="margin-right: 0;">' . $this->title . '</h1>');
     } else {
         en('<h1 style="margin-right: 0;">Onpub (on ' . $_SERVER['SERVER_NAME'] . ')</h1>');
     }
 }
コード例 #14
0
ファイル: OnpubLogin.php プロジェクト: onpubcom/onpub
 public function display()
 {
     en('<!DOCTYPE html>');
     en('<html>');
     en('<head>');
     en('<meta name="viewport" content="width=device-width; initial-scale=1.0">');
     en('<meta charset="ISO-8859-1">');
     en('<title>Onpub (on ' . $_SERVER['SERVER_NAME'] . ')</title>');
     /*
     if (file_exists(ONPUBGUI_YUI_DIRECTORY)) {
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'cssnormalize/cssnormalize-min.css">');
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'cssfonts/cssfonts-min.css">');
       en('<link rel="stylesheet" type="text/css" href="' . ONPUBGUI_YUI_DIRECTORY . 'cssgrids/cssgrids-min.css">');
     }
     else {
       en('<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?' . ONPUBGUI_YUI_VERSION . '/build/cssnormalize/cssnormalize-min.css&' . ONPUBGUI_YUI_VERSION . '/build/cssfonts/cssfonts-min.css&' . ONPUBGUI_YUI_VERSION . '/build/cssgrids/cssgrids-min.css">');
     }
     */
     en('<link rel="stylesheet" type="text/css" href="css/yui-combo-min.css">');
     en('<link href="//fonts.googleapis.com/css?family=Roboto:400,400italic,700,700italic" rel="stylesheet" type="text/css">');
     en('<link rel="stylesheet" type="text/css" href="css/onpub.css">');
     en('</head>');
     en('<body>');
     en('<div id="onpub-page" style="margin-top: 2em; width: 800px;">');
     en('<div id="onpub-body">');
     en('<div style="text-align: center; margin-top: 2em; margin-bottom: 1.5em;"><a href="index.php"><img src="images/onpub.png" width="222" height="89" alt="Onpub" title="Onpub"></a></div>');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1">');
     en('<form id="onpub-form" action="index.php" method="post">');
     en('<div style="width: 24%; margin-left: auto; margin-right: auto; margin-bottom: 2.25em;">');
     if (defined('ONPUBGUI_PDO_HOST')) {
         en('<input type="hidden" name="pdoHost" value="' . ONPUBGUI_PDO_HOST . '">');
     } else {
         en('<h3 class="onpub-field-header">Host</h3><p><input title="Host" type="text" maxlength="255" size="25" name="pdoHost" value="' . htmlentities($this->pdoHost) . '"></p>');
     }
     en('<h3 class="onpub-field-header">Username</h3><p><input title="Username" type="text" maxlength="255" size="25" name="pdoUser" value="' . htmlentities($this->pdoUser) . '"></p>');
     en('<h3 class="onpub-field-header">Password</h3><p><input title="Password" type="password" maxlength="255" size="25" name="pdoPassword" value=""></p>');
     en('<p><input type="submit" value="Login"> <a href="http://onpub.com/index.php?s=8&a=118#login" target="_blank"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'help.png" align="top" alt="Help" title="Help"></a></p>');
     if ($this->target) {
         $newTarget = "";
         if (is_array($this->target)) {
             $keys = array_keys($this->target);
             for ($i = 0; $i < sizeof($keys); $i++) {
                 $newTarget .= $keys[$i] . "=" . $this->target[$keys[$i]];
                 if ($i + 1 != sizeof($keys)) {
                     $newTarget .= "&";
                 }
             }
             $this->target = $newTarget;
         }
         en('<input type="hidden" name="target" value="' . $this->target . '">');
     }
     en('<input type="hidden" name="onpub" value="LoginProcess">');
     en('</div>');
     en('</form>');
     en('</div>');
     en('</div>');
     if ($this->exception) {
         en('<div class="yui3-g">');
         en('<div class="yui3-u-1">');
         en('<div style="text-align: center;">');
         switch ($this->exception->getCode()) {
             case 1044:
                 // Bad database name.
                 en('<h3><span class="onpub-error">Login error:</span> Invalid database name.</h3>');
                 break;
             case 1045:
                 // Bad credentials.
                 en('<h3><span class="onpub-error">Login error:</span> Invalid username and/or password.</h3>');
                 break;
             case 1049:
                 // Bad credentials.
                 en('<h3><span class="onpub-error">Login error:</span> Unknown database name.</h3>');
                 break;
             case 2002:
                 // Server is down
                 en('<h3><span class="onpub-error">Login error:</span> The MySQL server appears to be down.</h3>');
                 break;
             case 2003:
                 // Server is inaccessible (firewall, wrong port, etc.)
                 en('<h3><span class="onpub-error">Login error:</span> The MySQL server host is inaccessible.</h3>');
                 break;
             case 2005:
                 // Bad host name
                 en('<h3><span class="onpub-error">Login error:</span> The MySQL server host address is invalid.</h3>');
                 break;
             default:
                 en('<h3><span class="onpub-error">Login error:</span> ' . $this->exception->getMessage() . '</h3>');
                 break;
         }
         if ($this->exception->getMessage() == 'could not find driver') {
             en('<p>PDO_MYSQL is not installed or is not configured correctly.</p>');
             en('<p>Onpub requires the PDO and PDO_MYSQL PHP extensions in order to connect to a MySQL database server.</p>');
             en('<p>You will be unable to use Onpub until PDO_MYSQL is installed.</p>');
             en('<p>Please refer to the <a href="http://onpub.com/index.php?s=8&a=11" target="_blank">Onpub System Requirements</a> and the <a href="http://www.php.net/manual/en/ref.pdo-mysql.php" target="_blank">PHP Manual</a> for more information.</p>');
         } elseif ($this->exception->getCode() === 1) {
             en('<p>Onpub requires the PDO and PDO_MYSQL PHP extensions in order to connect to a MySQL database server.</p>');
             en('<p>You will be unable to use Onpub until PDO and PDO_MYSQL are installed.</p>');
             en('<p>Please refer to the <a href="http://onpub.com/index.php?s=8&a=11" target="_blank">Onpub System Requirements</a> and the <a href="http://www.php.net/manual/en/ref.pdo-mysql.php" target="_blank">PHP Manual</a> for more information.</p>');
         }
         en('</div>');
         en('</div>');
         en('</div>');
     }
     en('</div>');
     en('</div>');
     en('</body>');
     en('</html>');
 }
コード例 #15
0
ファイル: OnpubNewArticle.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $owebsites = new OnpubWebsites($this->pdo);
     $osections = new OnpubSections($this->pdo);
     $oimages = new OnpubImages($this->pdo);
     try {
         $queryOptions = new OnpubQueryOptions();
         $queryOptions->orderBy = "name";
         $queryOptions->order = "ASC";
         $websites = $owebsites->select($queryOptions);
         $queryOptions = new OnpubQueryOptions();
         $queryOptions->orderBy = "fileName";
         $queryOptions->order = "ASC";
         $images = $oimages->select($queryOptions);
     } catch (PDOException $e) {
         throw $e;
     }
     $widget = new OnpubWidgetHeader("New Article", ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="post">');
     en('<div>');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     if ($this->oarticle->title === NULL) {
         en('<p><span class="onpub-field-header">Title</span> <input type="text" maxlength="255" size="40" name="title" value=""> <img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'exclamation.png" align="top" alt="Required field" title="Required field"></p>');
     } else {
         en('<p><span class="onpub-field-header">Title</span> <input type="text" maxlength="255" size="40" name="title" value="' . htmlentities($this->oarticle->title) . '"></p>');
     }
     en('</div>');
     en('<div class="yui3-u-1-2">');
     en('<p><span class="onpub-field-header">Author</span> <input type="text" maxlength="255" size="40" name="displayAs" value="' . htmlentities($this->oauthor->displayAs) . '"></p>');
     en('</div>');
     en('</div>');
     en('<p><textarea rows="25" name="content" style="width: 100%;">' . htmlentities($this->oarticle->content) . '</textarea></p>');
     ?>
 <script type="text/javascript">
   if (CKEDITOR) {
     CKEDITOR.replace('content', {
       'height': 350,
       'uiColor': '#eff0f0',
       'resize_dir': 'vertical',
       'dataIndentationChars': '  ',
       'allowedContent': true,
       <?php 
     if (file_exists(ONPUBGUI_YUI_DIRECTORY)) {
         en("'contentsCss': [onpub_dir_yui + 'cssnormalize/cssnormalize-min.css', onpub_dir_yui + 'cssfonts/cssfonts-min.css', onpub_dir_yui + 'cssgrids/cssgrids-min.css', '" . ONPUBGUI_CKEDITOR_DIRECTORY . "contents.css', 'css/ckeditor.css']");
     } else {
         en("'contentsCss': ['http://yui.yahooapis.com/" . ONPUBGUI_YUI_VERSION . "/build/cssnormalize/cssnormalize-min.css', 'http://yui.yahooapis.com/" . ONPUBGUI_YUI_VERSION . "/build/cssfonts/cssfonts-min.css', 'http://yui.yahooapis.com/" . ONPUBGUI_YUI_VERSION . "/build/cssgrids/cssgrids-min.css', 'ckeditor/contents.css', 'css/ckeditor.css']");
     }
     ?>
     });
   }
 </script>
 <?php 
     $widget = new OnpubWidgetDateCreated($this->oarticle->getCreated());
     $widget->display();
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     $widget = new OnpubWidgetSections();
     $widget->sectionIDs = $this->oarticle->sectionIDs;
     $widget->websites = $websites;
     $widget->osections = $osections;
     $widget->display();
     en('</div>');
     en('<div class="yui3-u-1-2">');
     $widget = new OnpubWidgetImages("Image", $this->oarticle->imageID, $images);
     $widget->display();
     en('</div>');
     en('</div>');
     en('<input type="submit" value="Save">');
     en('<input type="hidden" name="onpub" value="NewArticleProcess">');
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #16
0
ファイル: OnpubFrontend.php プロジェクト: onpubcom/onpub
 protected function skel()
 {
     global $onpub_disp_rss, $onpub_dir_yui, $onpub_inc_css, $onpub_inc_css_menu, $onpub_inc_head, $onpub_inc_banner, $onpub_dir_root, $onpub_yui_version, $onpub_dir_frontend, $onpub_inc_foot, $onpub_disp_friendly_urls;
     header("Content-Type: text/html; charset=iso-8859-1");
     if ($onpub_disp_friendly_urls) {
         if ($this->currentArticle) {
             $sectionMaps = $this->samaps->select(null, null, $this->currentArticle->ID);
             $articleInSection = false;
             if ($this->currentSection) {
                 foreach ($sectionMaps as $sectionMap) {
                     if ($sectionMap->sectionID == $this->currentSection->ID) {
                         $articleInSection = true;
                         break;
                     }
                 }
             }
             if (!$articleInSection) {
                 if (sizeof($sectionMaps)) {
                     $sectionMap = $sectionMaps[0];
                     $this->currentSection = $this->sections->get($sectionMap->sectionID);
                 } else {
                     $this->currentSection = null;
                 }
             }
         }
         $friendlyURL = $this->generateFriendlyURL($this->currentSection, $this->currentArticle);
         $baseName = pathinfo(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), PATHINFO_BASENAME);
         if ($friendlyURL && $baseName && $friendlyURL != $baseName) {
             // Received a request for a non-friendly URL.
             // Re-direct permanently to the friendly equivalent.
             header('Location: ' . $friendlyURL, true, 301);
             return;
         }
     }
     session_name("onpubpdo");
     session_set_cookie_params(0, '/', '', false, true);
     session_start();
     $this->loginStatus = false;
     if (isset($_SESSION['PDO_HOST']) && isset($_SESSION['PDO_USER']) && isset($_SESSION['PDO_PASSWORD']) && isset($_SESSION['PDO_DATABASE'])) {
         $this->loginStatus = true;
     }
     en('<!DOCTYPE html>');
     en('<html>');
     en('<head>');
     $this->meta();
     $this->title();
     if ($this->website && $onpub_disp_rss) {
         en('<link rel="alternate" type="application/rss+xml" href="index.php?rss" title="' . $this->website->name . ' RSS Feed">');
     }
     if (file_exists($onpub_dir_yui)) {
         en('<link rel="stylesheet" type="text/css" href="' . $onpub_dir_frontend . 'css/yui-combo-min.css">');
         //en('<link rel="stylesheet" type="text/css" href="' . $onpub_dir_yui . 'cssnormalize/cssnormalize-min.css">');
         //en('<link rel="stylesheet" type="text/css" href="' . $onpub_dir_yui . 'cssfonts/cssfonts-min.css">');
         //en('<link rel="stylesheet" type="text/css" href="' . $onpub_dir_yui . 'cssgrids/cssgrids-min.css">');
         //en('<link rel="stylesheet" type="text/css" href="' . $onpub_dir_yui . 'cssgrids-responsive/cssgrids-responsive-min.css">');
         //en('<link rel="stylesheet" type="text/css" href="' . $onpub_dir_yui . 'node-menunav/assets/skins/sam/node-menunav.css">');
     } else {
         $onpub_dir_yui = null;
         en('<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?' . $onpub_yui_version . '/build/cssnormalize/cssnormalize-min.css&' . $onpub_yui_version . '/build/cssfonts/cssfonts-min.css&' . $onpub_yui_version . '/build/cssgrids/cssgrids-min.css&' . $onpub_yui_version . '/build/cssgrids-responsive/cssgrids-responsive-min.css&' . $onpub_yui_version . '/build/node-menunav/assets/skins/sam/node-menunav.css">');
     }
     en('<link href="//fonts.googleapis.com/css?family=Roboto:400,400italic,700,700italic" rel="stylesheet" type="text/css">');
     if (file_exists($onpub_inc_css)) {
         en('<link rel="stylesheet" type="text/css" href="' . $onpub_inc_css . '">');
     } else {
         en('<link rel="stylesheet" type="text/css" href="' . $onpub_dir_frontend . 'css/onpub.css">');
     }
     if (file_exists($onpub_inc_css_menu)) {
         en('<link rel="stylesheet" type="text/css" href="' . $onpub_inc_css_menu . '">');
     } else {
         en('<link rel="stylesheet" type="text/css" href="' . $onpub_dir_frontend . 'css/onpub-menu.css">');
     }
     en('<script type="text/javascript">');
     en('document.documentElement.className = "yui3-loading";');
     en('var onpub_dir_root = "' . $onpub_dir_root . '";');
     if ($onpub_dir_yui) {
         en('var onpub_dir_yui = "' . $onpub_dir_yui . '";');
     } else {
         en('var onpub_dir_yui = null;');
     }
     en('var onpub_yui_version = "' . $onpub_yui_version . '";');
     en('</script>');
     if (file_exists($onpub_inc_head)) {
         include $onpub_inc_head;
     }
     en('</head>');
     en('<body class="yui3-skin-sam">');
     if (file_exists($onpub_inc_banner)) {
         en('<div id="onpub-banner">');
         include $onpub_inc_banner;
         en('</div>');
     }
     en('<div id="onpub-header">');
     $this->header();
     en('</div>');
     en('<div id="onpub-page">');
     $this->menu();
     switch ($this->page) {
         case 'home':
             en('<div id="onpub-body">');
             $this->home();
             en('</div>');
             break;
         case 'section':
             en('<div id="onpub-body" style="padding-right: 0em;">');
             $this->section();
             en('</div>');
             break;
         case 'article':
             en('<div id="onpub-body">');
             $this->article();
             en('</div>');
             break;
         case 'section-article':
             en('<div id="onpub-body" style="padding-right: 0em;">');
             $this->sectionArticle();
             en('</div>');
             break;
         default:
             break;
     }
     en('</div>');
     en('<div id="onpub-footer">');
     en('<div id="onpub-footer-content">');
     $this->footer();
     en('</div>');
     en('</div>');
     if ($onpub_dir_yui) {
         en('<script type="text/javascript" src="' . $onpub_dir_yui . 'yui/yui-min.js"></script>');
     } else {
         en('<script type="text/javascript" src="http://yui.yahooapis.com/combo?' . $onpub_yui_version . '/build/yui/yui-min.js"></script>');
     }
     en('<script type="text/javascript" src="' . $onpub_dir_frontend . 'js/site.js"></script>');
     if (file_exists($onpub_inc_foot)) {
         include $onpub_inc_foot;
     }
     en('</body>');
     en('</html>');
 }
コード例 #17
0
ファイル: OnpubUploadImages.php プロジェクト: onpubcom/onpub
 public function displayException(Exception $e)
 {
     $owebsites = new OnpubWebsites($this->pdo);
     try {
         $website = $owebsites->get($this->websiteID);
     } catch (PDOException $e) {
         throw $e;
     }
     $widget = new OnpubWidgetHeader("Upload Images", ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     switch ($e->getCode()) {
         case ONPUBGUI_ERROR_MOVE_UPLOADED_FILE:
             en('<span class="onpub-error">' . $e->getMessage() . '</span>', 1, 2);
             en('Make sure the Image Uploads Directory of <a href="index.php?onpub=EditWebsite&amp;websiteID=' . $this->websiteID . '">' . $website->name . '</a> is a valid path and is writable by the web server account.');
             break;
         case ONPUBGUI_ERROR_IMAGE_EXISTS:
             en('<form id="onpub-form" action="index.php" method="post">');
             en('<div>');
             en('<p class="onpub-error"><i>' . $e->getMessage() . '</i> already exists.</p>');
             en('<p>Would you like to overwrite the existing image file?</p>');
             en('<p><input type="submit" id="keepImage" value="Keep Existing File"> <input type="submit" id="overwriteImage" value="Overwrite Existing File"></p>');
             en('<p><input type="hidden" name="websiteID" value="' . $this->websiteID . '"><p>');
             en('<p><input type="hidden" name="overwrite" value="0"><p>');
             en('<p><input type="hidden" name="overwriteFileName" value="' . $e->getMessage() . '"><p>');
             en('<p><input type="hidden" name="onpub" value="UploadImagesProcess"><p>');
             en('</div>');
             en('</form>');
             break;
         default:
             en('<span class="onpub-error">' . $e->getMessage() . '</span>');
             break;
     }
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #18
0
ファイル: OnpubEditImage.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $oimages = new OnpubImages($this->pdo);
     $owebsites = new OnpubWebsites($this->pdo);
     $imageFileSize = NULL;
     $imageWidth = NULL;
     $imageHeight = NULL;
     $imageDimensions = NULL;
     $imageFileInfo = NULL;
     $fileExists = FALSE;
     try {
         $this->oimage = $oimages->get($this->oimage->ID);
         $website = $owebsites->get($this->oimage->websiteID);
     } catch (PDOException $e) {
         throw $e;
     }
     $fileExists = file_exists(addTrailingSlash($website->imagesDirectory) . $this->oimage->fileName);
     if ($fileExists) {
         if (function_exists("getimagesize")) {
             $imageDimensions = getimagesize(addTrailingSlash($website->imagesDirectory) . $this->oimage->fileName);
         }
         $imageFileInfo = stat(addTrailingSlash($website->imagesDirectory) . $this->oimage->fileName);
     }
     if ($imageFileInfo) {
         $imageFileSize = $imageFileInfo[7];
     }
     if ($imageDimensions) {
         $imageWidth = $imageDimensions[0];
         $imageHeight = $imageDimensions[1];
     }
     $widget = new OnpubWidgetHeader("Image " . $this->oimage->ID . " - " . $this->oimage->fileName, ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="post">');
     en('<div>');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-3">');
     en('<h3 class="onpub-field-header">File Name</h3><p><input type="text" maxlength="255" size="' . 30 . '" name="fileName" value="' . htmlentities($this->oimage->fileName) . '"></p>');
     en('</div>');
     en('<div class="yui3-u-1-3">');
     en('<h3 class="onpub-field-header">Description</h3><p><input type="text" maxlength="255" size="' . 30 . '" name="description" value="' . htmlentities($this->oimage->description) . '"></p>');
     en('</div>');
     en('<div class="yui3-u-1-3">');
     en('<h3 class="onpub-field-header">Website</h3><p><a href="index.php?onpub=EditWebsite&amp;websiteID=' . $website->ID . '" title="Edit">' . $website->name . '</a></p>');
     en('</div>');
     en('</div>');
     if ($fileExists) {
         en('<div class="yui3-g">');
         en('<div class="yui3-u-1-3">');
         en('<h3 class="onpub-field-header">Width</h3><p>');
         en($imageWidth . 'px</p>');
         en('</div>');
         en('<div class="yui3-u-1-3">');
         en('<h3 class="onpub-field-header">Height</h3><p>');
         en($imageHeight . 'px</p>');
         en('</div>');
         en('<div class="yui3-u-1-3">');
         en('<h3 class="onpub-field-header">File Size</h3><p>');
         if ($imageFileSize >= 1024) {
             en(round($imageFileSize / 1024) . ' KB (' . $imageFileSize . ' bytes)</p>');
         } else {
             en($imageFileSize . ' bytes</p>');
         }
         en('</div>');
         en('</div>');
     }
     if ($website->imagesURL) {
         en('<div class="yui3-g">');
         en('<div class="yui3-u-1">');
         en('<h3 class="onpub-field-header">Frontend URL</h3><p><a href="' . addTrailingSlash($website->imagesURL) . $this->oimage->fileName . '" target="_blank">' . addTrailingSlash($website->imagesURL) . $this->oimage->fileName . '</a></p>');
         en('</div>');
         en('</div>');
     }
     if ($fileExists) {
         en('<div class="yui3-g">');
         en('<div class="yui3-u-1">');
         en('<h3 class="onpub-field-header">File Path</h3><p>' . addTrailingSlash($website->imagesDirectory) . $this->oimage->fileName . ' (on <i>' . $_SERVER['SERVER_NAME'] . '</i>)</p>');
         en('</div>');
         en('</div>');
     }
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-3">');
     en('<h3 class="onpub-field-header">Created</h3><p>' . $this->oimage->getCreated()->format('M j, Y g:i:s A') . '</p>');
     en('</div>');
     en('<div class="yui3-u-1-3">');
     en('<h3 class="onpub-field-header">Modified</h3><p>' . $this->oimage->getModified()->format('M j, Y g:i:s A') . '</p>');
     en('</div>');
     en('<div class="yui3-u-1-3">');
     en('</div>');
     en('</div>');
     en('<p><input type="submit" value="Save"> <input type="button" value="Delete" id="deleteImage"></p>');
     if (@fopen(addTrailingSlash($website->imagesURL) . rawurlencode($this->oimage->fileName), 'r')) {
         if ($imageWidth && $imageHeight) {
             en('<p style="margin-bottom: 0;"><a href="' . addTrailingSlash($website->imagesURL) . $this->oimage->fileName . '" target="_blank"><img src="' . addTrailingSlash($website->imagesURL) . $this->oimage->fileName . '" width="' . $imageWidth . '" height="' . $imageHeight . '" alt="' . $this->oimage->fileName . '" title="' . $this->oimage->fileName . '" border="0"></a></p>');
         } else {
             en('<p style="margin-bottom: 0;"><a href="' . addTrailingSlash($website->imagesURL) . $this->oimage->fileName . '" target="_blank"><img src="' . addTrailingSlash($website->imagesURL) . $this->oimage->fileName . '" alt="' . $this->oimage->fileName . '" title="' . $this->oimage->fileName . '" border="0"></a></p>');
         }
     } else {
         en('<p style="margin-bottom: 0;"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'picture_error.png" align="top" width="16" height="16" alt="Image not found" title="Image not found"> <span class="onpub-error">Make sure the Image Uploads URL of <a href="index.php?onpub=EditWebsite&amp;websiteID=' . $website->ID . '">' . $website->name . '</a> is setup correctly.</span></p>');
     }
     en('<input type="hidden" name="onpub" value="EditImageProcess">');
     en('<input type="hidden" name="imageID" value="' . $this->oimage->ID . '">');
     en('<input type="hidden" name="oldImageFileName" value="' . htmlentities($this->oimage->fileName) . '">');
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #19
0
 public function display()
 {
     $currentPage = 1;
     $this->keywords = urlencode($this->keywords);
     if ($this->page) {
         $currentPage = $this->page;
     }
     if ($this->totalItems > ONPUBGUI_PDO_ROW_LIMIT) {
         $this->pages = $this->totalItems / ONPUBGUI_PDO_ROW_LIMIT;
         if (is_double($this->pages)) {
             $this->pages = (int) $this->pages;
             $this->pages++;
         }
         en('<p>');
         if ($currentPage > 1) {
             if ($this->orderBy && $this->order) {
                 if ($this->keywords) {
                     if ($this->fullTextSearch) {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($currentPage - 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_back.gif" align="top" alt="Previous Page" title="Previous Page" width="16" height="16"></a>');
                     } else {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($currentPage - 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_back.gif" align="top" alt="Previous Page" title="Previous Page" width="16" height="16"></a>');
                     }
                 } else {
                     if ($this->id) {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($currentPage - 1) . '&amp;' . $this->idType . '=' . $this->id . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_back.gif" align="top" alt="Previous Page" title="Previous Page" width="16" height="16"></a>');
                     } else {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($currentPage - 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_back.gif" align="top" alt="Previous Page" title="Previous Page" width="16" height="16"></a>');
                     }
                 }
             } else {
                 if ($this->keywords) {
                     if ($this->fullTextSearch) {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;page=' . ($currentPage - 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_back.gif" align="top" alt="Previous Page" title="Previous Page" width="16" height="16"></a>');
                     } else {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;page=' . ($currentPage - 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_back.gif" align="top" alt="Previous Page" title="Previous Page" width="16" height="16"></a>');
                     }
                 } else {
                     if ($this->id) {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($currentPage - 1) . '&amp;' . $this->idType . '=' . $this->id . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_back.gif" align="top" alt="Previous Page" title="Previous Page" width="16" height="16"></a>');
                     } else {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($currentPage - 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_back.gif" align="top" alt="Previous Page" title="Previous Page" width="16" height="16"></a>');
                     }
                 }
             }
         } else {
             en('<img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_back.gif" align="top" alt="Previous Page" title="Previous Page" width="16" height="16">');
         }
         if ($this->pages > 11) {
             if ($currentPage > 6) {
                 if ($this->orderBy && $this->order) {
                     if ($this->keywords) {
                         if ($this->fullTextSearch) {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=1">1..</a>');
                         } else {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=1">1..</a>');
                         }
                     } else {
                         if ($this->id) {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=1&amp;' . $this->idType . '=' . $this->id . '">1..</a>');
                         } else {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=1">1..</a>');
                         }
                     }
                 } else {
                     if ($this->keywords) {
                         if ($this->fullTextSearch) {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;page=1">1..</a>');
                         } else {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;page=1">1..</a>');
                         }
                     } else {
                         if ($this->id) {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=1&amp;' . $this->idType . '=' . $this->id . '">1..</a>');
                         } else {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=1">1..</a>');
                         }
                     }
                 }
             } else {
                 en('1..');
             }
         }
         if ($this->pages < 11) {
             for ($j = 0; $j < $this->pages; $j++) {
                 if ($j + 1 == $currentPage) {
                     en('<strong>' . $currentPage . '</strong>');
                 } else {
                     if ($this->orderBy && $this->order) {
                         if ($this->keywords) {
                             if ($this->fullTextSearch) {
                                 en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                             } else {
                                 en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                             }
                         } else {
                             if ($this->id) {
                                 en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '&amp;' . $this->idType . '=' . $this->id . '">' . ($j + 1) . '</a>');
                             } else {
                                 en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                             }
                         }
                     } else {
                         if ($this->keywords) {
                             if ($this->fullTextSearch) {
                                 en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                             } else {
                                 en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                             }
                         } else {
                             if ($this->id) {
                                 en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($j + 1) . '&amp;' . $this->idType . '=' . $this->id . '">' . ($j + 1) . '</a>');
                             } else {
                                 en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                             }
                         }
                     }
                 }
             }
         } else {
             if ($currentPage < 7) {
                 for ($j = 0; $j < $this->pages; $j++) {
                     if ($j + 1 == $currentPage) {
                         en('<strong>' . $currentPage . '</strong>');
                     } else {
                         if ($j < 11) {
                             if ($this->orderBy && $this->order) {
                                 if ($this->keywords) {
                                     if ($this->fullTextSearch) {
                                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                     } else {
                                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                     }
                                 } else {
                                     if ($this->id) {
                                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '&amp;' . $this->idType . '=' . $this->id . '">' . ($j + 1) . '</a>');
                                     } else {
                                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                     }
                                 }
                             } else {
                                 if ($this->keywords) {
                                     if ($this->fullTextSearch) {
                                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                     } else {
                                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                     }
                                 } else {
                                     if ($this->id) {
                                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($j + 1) . '&amp;' . $this->idType . '=' . $this->id . '">' . ($j + 1) . '</a>');
                                     } else {
                                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                     }
                                 }
                             }
                         }
                     }
                 }
             } else {
                 if ($currentPage < $this->pages - 5) {
                     for ($j = $this->page - 6; $j < $this->pages; $j++) {
                         if ($j + 1 == $currentPage) {
                             en('<strong>' . $currentPage . '</strong>');
                         } else {
                             if ($j < $currentPage + 5) {
                                 if ($this->orderBy && $this->order) {
                                     if ($this->keywords) {
                                         if ($this->fullTextSearch) {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         } else {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         }
                                     } else {
                                         if ($this->id) {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '&amp;' . $this->idType . '=' . $this->id . '">' . ($j + 1) . '</a>');
                                         } else {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         }
                                     }
                                 } else {
                                     if ($this->keywords) {
                                         if ($this->fullTextSearch) {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         } else {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         }
                                     } else {
                                         if ($this->id) {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($j + 1) . '&amp;' . $this->idType . '=' . $this->id . '">' . ($j + 1) . '</a>');
                                         } else {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 } else {
                     for ($j = $this->pages - 11; $j < $this->pages; $j++) {
                         if ($j + 1 == $currentPage) {
                             en('<strong>' . $currentPage . '</strong>');
                         } else {
                             if ($j < $currentPage + 5) {
                                 if ($this->orderBy && $this->order) {
                                     if ($this->keywords) {
                                         if ($this->fullTextSearch) {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         } else {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         }
                                     } else {
                                         if ($this->id) {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '&amp;' . $this->idType . '=' . $this->id . '">' . ($j + 1) . '</a>');
                                         } else {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         }
                                     }
                                 } else {
                                     if ($this->keywords) {
                                         if ($this->fullTextSearch) {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         } else {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         }
                                     } else {
                                         if ($this->id) {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($j + 1) . '&amp;' . $this->idType . '=' . $this->id . '">' . ($j + 1) . '</a>');
                                         } else {
                                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($j + 1) . '">' . ($j + 1) . '</a>');
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         if ($this->pages > 11) {
             if ($currentPage + 5 < $this->pages) {
                 if ($this->orderBy && $this->order) {
                     if ($this->keywords) {
                         if ($this->fullTextSearch) {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . $this->pages . '">..' . $this->pages . '</a>');
                         } else {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . $this->pages . '">..' . $this->pages . '</a>');
                         }
                     } else {
                         if ($this->id) {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . $this->pages . '&amp;' . $this->idType . '=' . $this->id . '">..' . $this->pages . '</a>');
                         } else {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . $this->pages . '">..' . $this->pages . '</a>');
                         }
                     }
                 } else {
                     if ($this->keywords) {
                         if ($this->fullTextSearch) {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;page=' . $this->pages . '">..' . $this->pages . '</a>');
                         } else {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;page=' . $this->pages . '">..' . $this->pages . '</a>');
                         }
                     } else {
                         if ($this->id) {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . $this->pages . '&amp;' . $this->idType . '=' . $this->id . '">..' . $this->pages . '</a>');
                         } else {
                             en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . $this->pages . '">..' . $this->pages . '</a>');
                         }
                     }
                 }
             } else {
                 en('..' . $this->pages . '');
             }
         }
         if ($currentPage == $this->pages) {
             en('<img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_forward.gif" align="top" alt="Next Page" title="Next Page" width="16" height="16">');
         } else {
             if ($this->orderBy && $this->order) {
                 if ($this->keywords) {
                     if ($this->fullTextSearch) {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($currentPage + 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_forward.gif" align="top" alt="Next Page" title="Next Page" width="16" height="16"></a>');
                     } else {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($currentPage + 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_forward.gif" align="top" alt="Next Page" title="Next Page" width="16" height="16"></a>');
                     }
                 } else {
                     if ($this->id) {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($currentPage + 1) . '&amp;' . $this->idType . '=' . $this->id . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_forward.gif" align="top" alt="Next Page" title="Next Page" width="16" height="16"></a>');
                     } else {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;orderBy=' . $this->orderBy . '&amp;order=' . $this->order . '&amp;page=' . ($currentPage + 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_forward.gif" align="top" alt="Next Page" title="Next Page" width="16" height="16"></a>');
                     }
                 }
             } else {
                 if ($this->keywords) {
                     if ($this->fullTextSearch) {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;page=' . ($currentPage + 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_forward.gif" align="top" alt="Next Page" title="Next Page" width="16" height="16"></a>');
                     } else {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;keywords=' . $this->keywords . '&amp;page=' . ($currentPage + 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_forward.gif" align="top" alt="Next Page" title="Next Page" width="16" height="16"></a>');
                     }
                 } else {
                     if ($this->id) {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($currentPage + 1) . '&amp;' . $this->idType . '=' . $this->id . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_forward.gif" align="top" alt="Next Page" title="Next Page" width="16" height="16"></a>');
                     } else {
                         en('<a href="index.php?onpub=' . $this->onpub . '&amp;page=' . ($currentPage + 1) . '"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'action_forward.gif" align="top" alt="Next Page" title="Next Page" width="16" height="16"></a>');
                     }
                 }
             }
         }
         en('</p>');
     }
 }
コード例 #20
0
ファイル: OnpubWelcome.php プロジェクト: onpubcom/onpub
 public function display()
 {
     if ($this->pdo) {
         $odatabase = new OnpubDatabase($this->pdo);
         $oarticles = new OnpubArticles($this->pdo);
         $oauthors = new OnpubAuthors($this->pdo);
         $oimages = new OnpubImages($this->pdo);
         $osections = new OnpubSections($this->pdo);
         $owebsites = new OnpubWebsites($this->pdo);
         $status = $odatabase->status();
         $driver = $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME);
         $widget = new OnpubWidgetHeader("Dashboard", $status, $this->pdo);
     } else {
         $status = null;
         $widget = new OnpubWidgetHeader("Dashboard", $status, $this->pdo);
     }
     $widget->display();
     en('<div class="yui3-g">');
     if ($status == ONPUBAPI_SCHEMA_VERSION) {
         // Onpub schema is installed.
         $numsites = $owebsites->count();
         $numarticles = $oarticles->count();
         en('<div class="yui3-u-1-2">');
         en('<div style="padding-right: 1em;">');
         if ($numsites == 0) {
             en('<h3 style="margin-top: 0;">You are ready to start publishing content with Onpub.</h3>');
             en('<p><b><a href="index.php?onpub=NewWebsite">Create a website</a></b> to get started.</p>');
         } else {
             if ($numarticles) {
                 en('<form id="onpub-form" action="index.php" method="get">');
                 en('<div>');
                 en('<input type="hidden" name="onpub" value="EditArticles">');
                 en('<input type="hidden" name="fullTextSearch" value="1">');
                 en('<p style="margin-top: 0;"><input type="text" name="keywords" style="width: 18.5em;"> <input type="submit" value="Search Articles"></p>');
                 //en(' For what: <select name="onpub"><option value="EditArticles">Articles</option><option value="EditSections">Sections</option><option value="EditWebsites">Websites</option></select>');
                 en('</div>');
                 en('</form>');
             }
             $queryOptions = new OnpubQueryOptions();
             $queryOptions->rowLimit = 10;
             $queryOptions->orderBy = "created";
             $queryOptions->order = "DESC";
             $articles = $oarticles->select($queryOptions);
             if (sizeof($articles)) {
                 en('<table style="width: 100%;" colspan="2">');
                 en('<tr><th style="text-align: left; width: 75%;">Recent Articles</th><th>Created</th></tr>');
                 foreach ($articles as $article) {
                     en('<tr><td><a href="index.php?onpub=EditArticle&amp;articleID=' . $article->ID . '" title="Edit">' . $article->title . '</a></td><td>' . $article->getCreated()->format("M j, Y") . '</td></tr>');
                 }
                 en('</table>');
             }
         }
         en('<div class="yui3-g">');
         en('<div class="yui3-u-1-2">');
         en('<h3 style="margin-top: 0;">Quick Links</h3>');
         en('<ul>');
         en('<li><a href="index.php?onpub=NewArticle">New Article</a></li>');
         en('<li><a href="index.php?onpub=NewSection">New Section</a></li>');
         en('<li><a href="index.php?onpub=UploadImages">Upload Images</a></li>');
         en('</ul>');
         en('</div>');
         en('<div class="yui3-u-1-2">');
         en('<table style="float: right;">');
         en('<tr><th colspan="2">Content Stats</th></tr>');
         en('<tr><td><a href="index.php?onpub=EditArticles">Articles</a>:</td><td>' . $numarticles . '</td></tr>');
         //en('<tr><td>Authors:</td><td>' . $oauthors->count() . '</td></tr>');
         en('<tr><td><a href="index.php?onpub=EditImages">Images</a>:</td><td>' . $oimages->count() . '</td></tr>');
         en('<tr><td><a href="index.php?onpub=EditSections">Sections</a>:</td><td>' . $osections->count() . '</td></tr>');
         en('<tr><td><a href="index.php?onpub=EditWebsites">Websites</a>:</td><td>' . $numsites . '</td></tr>');
         en('</table>');
         en('</div>');
         en('</div>');
         en('</div>');
         en('</div>');
         en('<div class="yui3-u-1-2">');
     } elseif ($this->pdo === NULL) {
         en('<div class="yui3-u-1-2">');
         en('<h3><span class="onpub-error">PDOException:</span> ' . $this->pdoException->getMessage() . '</h3>');
         switch ($this->pdoException->getCode()) {
             case 1044:
                 // Bad database name.
                 en('<p>Onpub is unable to connect to the specified MySQL database.</p>');
                 break;
             case 1045:
                 // Bad credentials.
                 en('<p>Onpub is unable to connect to the specified MySQL database using the logged-in user\'s username and/or password.</p>');
                 en('<p>Try logging out and log back in with the correct MySQL credentials.</p>');
                 break;
             case 2002:
                 // Server is down
                 en('<p>Onpub is unable to connect to the database server.</p>');
                 en('<p>Start the specified MySQL server and reload this page to try again.</p>');
                 break;
             case 2003:
                 // Server is inaccessible (firewall, wrong port, etc.)
                 en('<p>Onpub is unable to access the specified MySQL database server.</p>');
                 break;
             case 2005:
                 // Bad host name
                 en('<p>Onpub is unable to connect to the specified MySQL database server host.</p>');
                 break;
         }
         if ($this->pdoException->getMessage() == 'could not find driver') {
             en('<p>Either PDO_MYSQL is not installed or it is not configured correctly.</p>');
             en('<p>Onpub requires the PDO and PDO_MYSQL PHP extensions in order to connect to a MySQL database server.</p>');
             en('<p>You will be unable to use Onpub until PDO_MYSQL is installed.</p>');
             en('<p>Please refer to the <a href="http://onpub.com/index.php?s=8&a=11" target="_blank">Onpub System Requirements</a> and the <a href="http://www.php.net/manual/en/ref.pdo-mysql.php" target="_blank">PHP Manual</a> for more information.</p>');
         }
         en('</div>');
         en('<div class="yui3-u-1-2">');
     } else {
         // Onpub schema is not installed yet. Prompt user to install.
         en('<div class="yui3-u-1-2">');
         en('<h2 style="margin-top: 0;">Welcome to Onpub</h2>');
         if ($odatabase->current()) {
             en('<p>This appears to be the first time you have connected to this MySQL database with Onpub.</p>');
             en('<p>Before you can publish a website with Onpub, you must add the Onpub schema to the connected database: <em>' . $_SESSION['PDO_DATABASE'] . '</em>.</p>');
             en('<p>Please click the link below to continue:</p>');
             en('<ul><li><b><a href="index.php?onpub=SchemaInstall">Install the Onpub MySQL database schema</a></b></li></ul>');
         } else {
             $dbs = $odatabase->listDBs();
             if (sizeof($dbs)) {
                 en('<p>Please select the MySQL Database that you would like to work with and click Connect.</p>');
                 en('<form id="onpub-form" action="index.php" method="post">');
                 en('<div>');
                 en('<p>');
                 en('<select name="pdoDatabase">');
                 foreach ($dbs as $db) {
                     en('<option value="' . $db . '">' . $db . '</option>');
                 }
                 en('</select>');
                 en('</p>');
                 en('<p><input type="submit" value="Connect"></p>');
                 en('<input type="hidden" name="onpub" value="LoginProcess">');
                 en('</div>');
                 en('</form>');
             } else {
                 // User has no database permissions.
                 en('<p>Your MySQL User <em>' . $_SESSION['PDO_USER'] . '</em> does not have the permissions to access any databases on this host.</p>');
                 en('<p><a href="http://onpub.com/index.php?s=8&a=118#setup" target="_blank">Click here for instructions</a> on how to setup a MySQL User and Database for use with Onpub.');
             }
         }
         en('</div>');
         en('<div class="yui3-u-1-2">');
     }
     if ($this->pdo) {
         en('<table>');
         en('<tr><th colspan="2">Database Connection</th></tr>');
         en('<tr style="vertical-align: top;"><td>MySQL Host:</td><td>' . $this->pdo->getAttribute(PDO::ATTR_CONNECTION_STATUS) . '</td></tr>');
         en('<tr style="vertical-align: top;"><td>MySQL Client:</td><td>' . $this->pdo->getAttribute(PDO::ATTR_CLIENT_VERSION) . '</td></tr>');
         en('<tr style="vertical-align: top;"><td>MySQL Server:</td><td>' . $this->pdo->getAttribute(PDO::ATTR_SERVER_VERSION) . '</td></tr>');
         en('<tr style="vertical-align: top;"><td>MySQL User:</td><td>' . $_SESSION['PDO_USER'] . '</td></tr>');
         if ($_SESSION['PDO_DATABASE']) {
             en('<tr style="vertical-align: top;"><td>Connected Database:</td><td>' . $_SESSION['PDO_DATABASE'] . ' (<a href="index.php?onpub=Disconnect">Disconnect</a>)</td></tr>');
         }
         if ($status == ONPUBAPI_SCHEMA_VERSION) {
             en('<tr style="vertical-align: top;"><td>Onpub Schema:</td><td>Rev. ' . ONPUBAPI_SCHEMA_VERSION . '</td></tr>');
         }
         en('</table>');
         en('<table>');
         en('<tr><th colspan="2">PHP Configuration</th></tr>');
         if (function_exists("gd_info")) {
             $gdinfo = gd_info();
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/manual/en/book.image.php" target="_blank">GD</a>:</td><td>Installed: ' . $gdinfo['GD Version'] . '</td></tr>');
         } else {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/manual/en/book.image.php" target="_blank">GD</a>:</td><td><span class="onpub-error">Not installed.</span> <a href="http://php.net/manual/en/image.setup.php" target="_blank">Installing GD</a> is required.</td></tr>');
         }
         if (get_magic_quotes_gpc()) {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc" target="_blank">Magic Quotes</a>:</td><td><span class="onpub-error">On</span>: <a href="http://php.net/manual/en/security.magicquotes.disabling.php" target="_blank">Disabling Magic Quotes</a> is required.</td></tr>');
         } else {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc" target="_blank">Magic Quotes</a>:</td><td>Off</td></tr>');
         }
         if (ini_get("allow_url_fopen")) {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen" target="_blank">Allow URL File Open</a>:</td><td>Yes</td></tr>');
         } else {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen" target="_blank">Allow URL File Open</a>:</td><td><span class="onpub-error">No</span>: <a href="http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen" target="_blank">Enabling URL File Open</a> is required.</td></tr>');
         }
         if (ini_get("file_uploads")) {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/ini.core#ini.file-uploads" target="_blank">Allow File Uploads</a>:</td><td>Yes</td></tr>');
         } else {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/ini.core#ini.file-uploads" target="_blank">Allow File Uploads</a>:</td><td>No</td></tr>');
         }
         if (ini_get("upload_max_filesize")) {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/ini.core#ini.upload-max-filesize" target="_blank">Upload Maximum File Size</a>:</td><td>' . ini_get("upload_max_filesize") . '</td></tr>');
         } else {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/ini.core#ini.upload-max-filesize" target="_blank">Upload Maximum File Size</a>:</td><td>undefined</td></tr>');
         }
         if (ini_get("date.timezone")) {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/ref.datetime" target="_blank">Timezone</a>:</td><td>' . ini_get("date.timezone") . '</td></tr>');
         } else {
             en('<tr style="vertical-align: top;"><td><a href="http://php.net/ref.datetime" target="_blank">Timezone</a>:</td><td>' . ONPUBGUI_DEFAULT_TZ . '</td></tr>');
         }
         en('</table>');
     }
     en('</div>');
     en('</div>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #21
0
ファイル: index.php プロジェクト: Eugen1985/stalker_portal
<?php 
include_once 'tv_chanels.php';
include_once 'video.php';
$done_test = 0;
$fail_test = 0;
$url_test = "http://v2.api.sandbox.infomir.com.ua";
$url_test_auth = "http://auth.sandbox.infomir.com.ua/token";
echo "<h1>Testing</h1><hr />";
$html = '<table border=1px>';
echo $html;
$rkey = login();
$key = refresh_login();
users_login();
tv_chanel();
video();
en();
$html = '</table><hr />';
$html .= 'Удачных тестов: ' . $done_test . ', провалено тестов: ' . $fail_test;
echo $html;
function refresh_login()
{
    $html = '';
    global $done_test, $fail_test, $rkey, $url_test_auth;
    $data_url = "grant_type=refresh_token&refresh_token={$rkey}";
    try {
        $json_string = file_get_contents($url_test_auth, false, stream_context_create(array('http' => array('method' => 'POST', 'content' => $data_url))));
        $obj = json_decode($json_string);
        $html .= "<tr><td colspan=2><h3>Восстановление ключа: </h3></td></tr><tr><td>Ответ:</h3></td><td>" . $json_string . "</td></tr>";
        $html .= "<tr><td><b>Статус:</b></td><td color='black'>";
        $html .= "'token_type' : ";
        if (empty($obj->token_type)) {
コード例 #22
0
 public function display()
 {
     en('<h3 class="onpub-field-header">Created</h3>', 1);
     en('<p>');
     en('Year: <input type="text" maxlength="4" size="4" name="createdYear" value="' . $this->created['year'] . '">');
     en('Month:');
     en('<select name="createdMonth">');
     for ($i = 1; $i <= 12; $i++) {
         $month = "";
         switch ($i) {
             case 1:
                 $month = "Jan";
                 break;
             case 2:
                 $month = "Feb";
                 break;
             case 3:
                 $month = "Mar";
                 break;
             case 4:
                 $month = "Apr";
                 break;
             case 5:
                 $month = "May";
                 break;
             case 6:
                 $month = "Jun";
                 break;
             case 7:
                 $month = "Jul";
                 break;
             case 8:
                 $month = "Aug";
                 break;
             case 9:
                 $month = "Sep";
                 break;
             case 10:
                 $month = "Oct";
                 break;
             case 11:
                 $month = "Nov";
                 break;
             case 12:
                 $month = "Dec";
                 break;
         }
         if ($this->created['month'] == $i) {
             en('<option value="' . $i . '" selected="selected">' . $month . '</option>');
         } else {
             en('<option value="' . $i . '">' . $month . '</option>');
         }
     }
     en('</select>');
     en('Day: <input type="text" maxlength="2" size="2" name="createdDay" value="' . $this->created['day'] . '">');
     en('Hour:');
     en('<select name="createdHour">');
     for ($i = 0; $i < 24; $i++) {
         if ($i < 10) {
             $num = "0" . $i;
         } else {
             $num = $i;
         }
         if ($this->created['hour'] == $i) {
             en('<option value="' . $num . '" selected="selected">' . $num . '</option>');
         } else {
             en('<option value="' . $num . '">' . $num . '</option>');
         }
     }
     en('</select>');
     en('Minute:');
     en('<select name="createdMinute">');
     for ($i = 0; $i < 60; $i++) {
         if ($i < 10) {
             $num = "0" . $i;
         } else {
             $num = $i;
         }
         if ($this->created['minute'] == $i) {
             en('<option value="' . $num . '" selected="selected">' . $num . '</option>');
         } else {
             en('<option value="' . $num . '">' . $num . '</option>');
         }
     }
     en('</select>');
     en('Second:');
     en('<select name="createdSecond">');
     for ($i = 0; $i < 60; $i++) {
         if ($i < 10) {
             $num = "0" . $i;
         } else {
             $num = $i;
         }
         if ($this->created['second'] == $i) {
             en('<option value="' . $num . '" selected="selected">' . $num . '</option>');
         } else {
             en('<option value="' . $num . '">' . $num . '</option>');
         }
     }
     en('</select>');
     en('</p>');
 }
コード例 #23
0
ファイル: OnpubEditArticle.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $oarticles = new OnpubArticles($this->pdo);
     $owebsites = new OnpubWebsites($this->pdo);
     $osamaps = new OnpubSAMaps($this->pdo);
     $osections = new OnpubSections($this->pdo);
     $oimages = new OnpubImages($this->pdo);
     try {
         $queryOptions = new OnpubQueryOptions();
         $queryOptions->includeAuthors = TRUE;
         $this->oarticle = $oarticles->get($this->oarticle->ID, $queryOptions);
         $queryOptions = new OnpubQueryOptions();
         $queryOptions->orderBy = "fileName";
         $queryOptions->order = "ASC";
         $images = $oimages->select($queryOptions);
         $queryOptions = new OnpubQueryOptions();
         $queryOptions->orderBy = "name";
         $queryOptions->order = "ASC";
         $websites = $owebsites->select($queryOptions);
         $queryOptions = new OnpubQueryOptions();
         $samaps = $osamaps->select($queryOptions, NULL, $this->oarticle->ID);
     } catch (PDOException $e) {
         throw $e;
     }
     $author = $this->oarticle->authors;
     if (sizeof($author)) {
         $author = $author[0];
     } else {
         $author = new OnpubAuthor();
     }
     $widget = new OnpubWidgetHeader("Article " . $this->oarticle->ID . " - " . $this->oarticle->title, ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="post">');
     en('<div>');
     en('<p><textarea rows="25" name="content" style="width: 100%;">' . htmlentities($this->oarticle->content) . '</textarea></p>');
     ?>
 <script type="text/javascript">
   if (CKEDITOR) {
     CKEDITOR.replace('content', {
       'height': 350,
       'uiColor': '#eff0f0',
       'resize_dir': 'vertical',
       'dataIndentationChars': '  ',
       'allowedContent': true,
       <?php 
     if (file_exists(ONPUBGUI_YUI_DIRECTORY)) {
         en("'contentsCss': [onpub_dir_yui + 'cssnormalize/cssnormalize-min.css', onpub_dir_yui + 'cssfonts/cssfonts-min.css', onpub_dir_yui + 'cssgrids/cssgrids-min.css', '" . ONPUBGUI_CKEDITOR_DIRECTORY . "contents.css', 'css/ckeditor.css']");
     } else {
         en("'contentsCss': ['http://yui.yahooapis.com/" . ONPUBGUI_YUI_VERSION . "/build/cssnormalize/cssnormalize-min.css', 'http://yui.yahooapis.com/" . ONPUBGUI_YUI_VERSION . "/build/cssfonts/cssfonts-min.css', 'http://yui.yahooapis.com/" . ONPUBGUI_YUI_VERSION . "/build/cssgrids/cssgrids-min.css', '" . ONPUBGUI_CKEDITOR_DIRECTORY . "contents.css', 'css/ckeditor.css']");
     }
     ?>
     });
   }
 </script>
 <?php 
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     en('<h3 class="onpub-field-header">Title</h3><p><input type="text" maxlength="255" size="40" name="title" value="' . htmlentities($this->oarticle->title) . '"></p>');
     en('</div>');
     en('<div class="yui3-u-1-2">');
     en('<h3 class="onpub-field-header">Author</h3><p><input type="text" maxlength="255" size="40" name="displayAs" value="' . htmlentities($author->displayAs) . '"></p>');
     en('</div>');
     en('</div>');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     $widget = new OnpubWidgetSections();
     $widget->websites = $websites;
     $widget->osections = $osections;
     $widget->samaps = $samaps;
     $widget->display();
     en('</div>');
     en('<div class="yui3-u-1-2">');
     $widget = new OnpubWidgetImages("Image", $this->oarticle->imageID, $images);
     $widget->display();
     en('</div>');
     en('</div>');
     if ($this->oarticle->url) {
         $go = ' <a href="' . $this->oarticle->url . '" target="_blank"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'world_go.png" border="0" align="top" alt="Go" title="Go" width="16" height="16"></a>';
     } else {
         $go = '';
     }
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     en('<h3 class="onpub-field-header">Static Link</h3><p><small>The Frontend will link this article to the path or URL entered below.<br>Leave blank to use auto-generated Frontend URLs.</small><br><input type="text" maxlength="255" size="40" name="url" value="' . htmlentities($this->oarticle->url) . '">' . $go . '</p>');
     en('</div>');
     en('<div class="yui3-u-1-2">');
     if (sizeof($samaps)) {
         $websitesMap = array();
         foreach ($websites as $website) {
             $websitesMap["{$website->ID}"] = $website;
         }
         $sections = array();
         $articleIDs = array();
         foreach ($samaps as $samap) {
             $section = $osections->get($samap->sectionID);
             if ($section && isset($websitesMap["{$section->websiteID}"])) {
                 $website = $websitesMap["{$section->websiteID}"];
                 if ($website->url) {
                     $sections[] = $section;
                     $articleIDs[] = $samap->articleID;
                 }
             }
         }
         if (sizeof($sections)) {
             $urlLabel = sizeof($sections) > 1 ? 'URLs' : 'URL';
             en('<h3 class="onpub-field-header">Frontend ' . $urlLabel . '</h3>');
             en('<p>');
             en('<small>This article is displayed by the Frontend at the ' . $urlLabel . ' listed below.</small><br>');
             for ($i = 0; $i < sizeof($sections); $i++) {
                 $section = $sections[$i];
                 $website = $websitesMap["{$section->websiteID}"];
                 $frontendURL = addTrailingSlash($website->url) . 'index.php?s=' . $section->ID . '&amp;a=' . $articleIDs[$i];
                 en('&bull; <a href="' . $frontendURL . '" target="_blank">' . $frontendURL . '</a>');
                 if ($i + 1 != sizeof($sections)) {
                     en('<br>');
                 }
             }
             en('</p>');
         }
     }
     en('</div>');
     en('</div>');
     $widget = new OnpubWidgetDateCreated($this->oarticle->getCreated());
     $widget->display();
     $modified = $this->oarticle->getModified();
     en('<h3 class="onpub-field-header">Modified</h3><p>' . $modified->format('M j, Y g:i:s A') . '</p>');
     en('<input type="submit" value="Save"> <input type="button" value="Delete" id="deleteArticle">');
     en('<input type="hidden" name="articleID" id="articleID" value="' . $this->oarticle->ID . '">');
     en('<input type="hidden" name="authorID" value="' . $author->ID . '">');
     en('<input type="hidden" name="authorImageID" value="' . $author->imageID . '">');
     en('<input type="hidden" name="lastDisplayAs" value="' . htmlentities($author->displayAs) . '">');
     en('<input type="hidden" name="onpub" value="EditArticleProcess">');
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #24
0
ファイル: OnpubEditArticles.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $oarticles = new OnpubArticles($this->pdo);
     $owebsites = new OnpubWebsites($this->pdo);
     $osections = new OnpubSections($this->pdo);
     $counter = 0;
     $currentPage = 1;
     try {
         $queryOptions = new OnpubQueryOptions();
         $queryOptions->orderBy = "name";
         $queryOptions->order = "ASC";
         $websites = $owebsites->select($queryOptions);
     } catch (PDOException $e) {
         $widget = new OnpubWidgetPDOException($e);
         $widget->display();
         return;
     }
     if ($this->page) {
         $currentPage = $this->page;
     }
     if ($this->orderBy && $this->order) {
         if ($this->keywords) {
             try {
                 $queryOptions = new OnpubQueryOptions();
                 $queryOptions->includeContent = FALSE;
                 $queryOptions->fullTextSearch = $this->fullTextSearch;
                 $queryOptions->orderBy = $this->orderBy;
                 $queryOptions->order = $this->order;
                 $articles = $oarticles->search($this->keywords, $queryOptions);
             } catch (PDOException $e) {
                 $widget = new OnpubWidgetPDOException($e);
                 $widget->display();
                 return;
             }
             $totalArticles = sizeof($articles);
         } else {
             if ($this->sectionID) {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->includeContent = FALSE;
                     $queryOptions->orderBy = $this->orderBy;
                     $queryOptions->order = $this->order;
                     $queryOptions->setPage($currentPage, ONPUBGUI_PDO_ROW_LIMIT);
                     $articles = $oarticles->select($queryOptions, $this->sectionID);
                     $totalArticles = $oarticles->count($this->sectionID);
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
             } else {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->includeContent = FALSE;
                     $queryOptions->orderBy = $this->orderBy;
                     $queryOptions->order = $this->order;
                     $queryOptions->setPage($currentPage, ONPUBGUI_PDO_ROW_LIMIT);
                     $articles = $oarticles->select($queryOptions);
                     $totalArticles = $oarticles->count();
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
             }
         }
     } else {
         if ($this->keywords) {
             try {
                 $queryOptions = new OnpubQueryOptions();
                 $queryOptions->includeContent = FALSE;
                 $queryOptions->fullTextSearch = $this->fullTextSearch;
                 $queryOptions->orderBy = "created";
                 $queryOptions->order = "DESC";
                 $articles = $oarticles->search($this->keywords, $queryOptions);
             } catch (PDOException $e) {
                 $widget = new OnpubWidgetPDOException($e);
                 $widget->display();
                 return;
             }
             $totalArticles = sizeof($articles);
         } else {
             if ($this->sectionID) {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->includeContent = FALSE;
                     $queryOptions->orderBy = "created";
                     $queryOptions->order = "DESC";
                     $queryOptions->setPage($currentPage, ONPUBGUI_PDO_ROW_LIMIT);
                     $articles = $oarticles->select($queryOptions, $this->sectionID);
                     $totalArticles = $oarticles->count($this->sectionID);
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
             } else {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->includeContent = FALSE;
                     $queryOptions->orderBy = "created";
                     $queryOptions->order = "DESC";
                     $queryOptions->setPage($currentPage, ONPUBGUI_PDO_ROW_LIMIT);
                     $articles = $oarticles->select($queryOptions);
                     $totalArticles = $oarticles->count();
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
             }
         }
     }
     $widget = new OnpubWidgetHeader("Articles", ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="get">');
     en('<div>');
     en('<input type="hidden" name="onpub" value="EditArticles">');
     if ($totalArticles) {
         if (!$this->keywords) {
             $widget = new OnpubWidgetSections();
             $widget->websites = $websites;
             $widget->osections = $osections;
             $widget->heading = "Display articles in..";
             $widget->fieldName = "sectionID";
             $widget->multiple = false;
             $widget->defaultOptionText = "All Sections";
             if ($this->sectionID) {
                 $widget->sectionIDs = array($this->sectionID);
             }
             $widget->display();
         }
         $widget = new OnpubWidgetPaginator($totalArticles, $this->orderBy, $this->order, $this->page, $this->keywords, $this->fullTextSearch, "sectionID", $this->sectionID, "EditArticles");
         $widget->display();
         en('<table>');
         en('<tr>');
         en('<td></td>');
         if ($this->keywords) {
             $this->keywords = urlencode($this->keywords);
             if ($this->fullTextSearch) {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=ASC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "title":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=title&amp;order=DESC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             } else {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=ASC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "title":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=title&amp;order=DESC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             }
             $this->keywords = urldecode($this->keywords);
         } else {
             if ($this->sectionID) {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC&sectionID=' . $this->sectionID . '">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=ASC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC&sectionID=' . $this->sectionID . '">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "title":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=DESC&sectionID=' . $this->sectionID . '">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC&sectionID=' . $this->sectionID . '">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC&sectionID=' . $this->sectionID . '">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC&sectionID=' . $this->sectionID . '">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=ASC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC&sectionID=' . $this->sectionID . '">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=ASC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             } else {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=ASC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "title":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=DESC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=title&amp;order=ASC">Title</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditArticles&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             }
         }
         en('</tr>');
         if ($this->keywords) {
             $index = ($currentPage - 1) * ONPUBGUI_PDO_ROW_LIMIT;
         } else {
             $index = 0;
         }
         for ($i = 0; $i < ONPUBGUI_PDO_ROW_LIMIT && $index < sizeof($articles); $i++) {
             $articleID = $articles[$index]->ID;
             $title = $articles[$index]->title;
             $created = $articles[$index]->getCreated()->format("M j, Y");
             en('<tr valign="top">');
             en('<td align="right"><input type="checkbox" id="articleIDs" value="' . $articleID . '"></td>');
             switch ($this->order) {
                 case "ASC":
                     switch ($counter) {
                         case 0:
                             en('<td class="onpub-highlight1" align="right">' . $articleID . '</td>');
                             en('<td class="onpub-highlight1" align="left"><a href="index.php?onpub=EditArticle&amp;articleID=' . $articleID . '" title="Edit">' . $title . '</a></td>');
                             en('<td class="onpub-highlight1" align="left">' . $created . '</td>');
                             break;
                         case 1:
                             en('<td class="onpub-highlight2" align="right">' . $articleID . '</td>');
                             en('<td class="onpub-highlight2" align="left"><a href="index.php?onpub=EditArticle&amp;articleID=' . $articleID . '" title="Edit">' . $title . '</a></td>');
                             en('<td class="onpub-highlight2" align="left">' . $created . '</td>');
                             break;
                     }
                     break;
                 case "DESC":
                     switch ($counter) {
                         case 0:
                             en('<td class="onpub-highlight1" align="right">' . $articleID . '</td>');
                             en('<td class="onpub-highlight1" align="left"><a href="index.php?onpub=EditArticle&amp;articleID=' . $articleID . '" title="Edit">' . $title . '</a></td>');
                             en('<td class="onpub-highlight1" align="left">' . $created . '</td>');
                             break;
                         case 1:
                             en('<td class="onpub-highlight2" align="right">' . $articleID . '</td>');
                             en('<td class="onpub-highlight2" align="left"><a href="index.php?onpub=EditArticle&amp;articleID=' . $articleID . '" title="Edit">' . $title . '</a></td>');
                             en('<td class="onpub-highlight2" align="left">' . $created . '</td>');
                             break;
                     }
                     break;
                 default:
                     switch ($counter) {
                         case 0:
                             en('<td class="onpub-highlight1" align="right">' . $articleID . '</td>');
                             en('<td class="onpub-highlight1" align="left"><a href="index.php?onpub=EditArticle&amp;articleID=' . $articleID . '" title="Edit">' . $title . '</a></td>');
                             en('<td class="onpub-highlight1" align="left">' . $created . '</td>');
                             break;
                         case 1:
                             en('<td class="onpub-highlight2" align="right">' . $articleID . '</td>');
                             en('<td class="onpub-highlight2" align="left"><a href="index.php?onpub=EditArticle&amp;articleID=' . $articleID . '" title="Edit">' . $title . '</a></td>');
                             en('<td class="onpub-highlight2" align="left">' . $created . '</td>');
                             break;
                     }
                     break;
             }
             en('</tr>');
             if ($counter + 1 == 2) {
                 $counter = 0;
             } else {
                 $counter++;
             }
             $index++;
         }
         en('</table>');
     } else {
         if ($this->keywords) {
             en('<p>Your search did not yield any results. <a href="index.php?onpub=EditArticles">Display all articles</a>.</p>');
         } else {
             if ($this->sectionID) {
                 $widget = new OnpubWidgetSections();
                 $widget->websites = $websites;
                 $widget->osections = $osections;
                 $widget->heading = "Display articles in..";
                 $widget->fieldName = "sectionID";
                 $widget->multiple = false;
                 $widget->defaultOptionText = "All Sections";
                 if ($this->sectionID) {
                     $widget->sectionIDs = array($this->sectionID);
                 }
                 $widget->display();
                 en('<p>There are 0 articles in the selected section. <a href="index.php?onpub=EditArticles&amp;sectionID=">Display all articles</a>.</p>');
             } else {
                 en('<p>There are 0 articles in the database. <a href="index.php?onpub=NewArticle">New Article</a>.</p>');
             }
         }
     }
     if ($totalArticles) {
         en('<p>');
         en('<select id="actions">');
         en('<option value="EditArticles">Select an action..</option>');
         en('<option value="DeleteArticle">Delete selected articles</option>');
         en('<option value="ArticleMove">Move selected articles</option>');
         en('</select>');
         en('</p>');
         $widget = new OnpubWidgetStats($totalArticles, $this->keywords, $this->sectionID, "Article", "Section");
         $widget->display();
     }
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #25
0
 private function outputSections($websiteName, $section)
 {
     $subSections = $section->sections;
     $parentID = NULL;
     if ($this->osection) {
         $parentID = $this->osection->ID;
     }
     if (!$section->parentID) {
         if ($section->ID != $parentID) {
             if (sizeof($this->sectionIDs) && in_array($section->ID, $this->sectionIDs)) {
                 en('<option value="' . $section->ID . '" selected="selected">' . $websiteName . ' &ndash; ' . strip_tags($section->name) . '</option>');
             } else {
                 en('<option value="' . $section->ID . '">' . $websiteName . ' &ndash; ' . strip_tags($section->name) . '</option>');
             }
         }
     }
     for ($i = 0; $i < sizeof($subSections); $i++) {
         $subSection = $subSections[$i];
         $sectionName = $websiteName;
         $sectionNames = array();
         $sectionNames[] = $subSection->name;
         if ($subSection->parentID) {
             $parent = $subSection->parent;
             $sectionNames[] = $parent->name;
             if (!in_array($parent->ID, $this->parentIDs)) {
                 $this->parentIDs[] = $parent->ID;
             }
             while ($parent->parentID) {
                 $parent = $parent->parent;
                 $sectionNames[] = $parent->name;
                 if (!in_array($parent->ID, $this->parentIDs)) {
                     $this->parentIDs[] = $parent->ID;
                 }
             }
         }
         $sectionNames = array_reverse($sectionNames);
         foreach ($sectionNames as $sN) {
             $sectionName .= ' &ndash; ' . $sN;
         }
         if ($subSection->ID != $parentID && !in_array($parentID, $this->parentIDs)) {
             if (sizeof($this->sectionIDs) && in_array($subSection->ID, $this->sectionIDs)) {
                 en('<option value="' . $subSection->ID . '" selected="selected">' . strip_tags($sectionName) . '</option>');
             } else {
                 en('<option value="' . $subSection->ID . '">' . strip_tags($sectionName) . '</option>');
             }
         }
         $this->outputSections($websiteName, $subSection);
     }
     $this->parentIDs = array();
 }
コード例 #26
0
ファイル: OnpubEditSection.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $osections = new OnpubSections($this->pdo);
     $owebsites = new OnpubWebsites($this->pdo);
     $oarticles = new OnpubArticles($this->pdo);
     $oimages = new OnpubImages($this->pdo);
     $owsmaps = new OnpubWSMaps($this->pdo);
     $queryOptions = new OnpubQueryOptions();
     $queryOptions->includeArticles = TRUE;
     $queryOptions->includeContent = FALSE;
     try {
         $this->osection = $osections->get($this->osection->ID, $queryOptions);
         $website = $owebsites->get($this->osection->websiteID);
         $numOfArticles = $oarticles->count();
         $queryOptions = new OnpubQueryOptions();
         $queryOptions->orderBy = "fileName";
         $queryOptions->order = "ASC";
         $images = $oimages->select($queryOptions);
         $wsmap = new OnpubWSMap();
         $wsmap->websiteID = $this->osection->websiteID;
         $wsmap->sectionID = $this->osection->ID;
         $this->visible = $owsmaps->getID($wsmap);
         $wsmaps = $owsmaps->select(NULL, NULL, $this->osection->ID);
         $queryOptions = new OnpubQueryOptions();
         $queryOptions->orderBy = "name";
         $queryOptions->order = "ASC";
         if (sizeof($wsmaps)) {
             $websites = $owebsites->select($queryOptions);
         } else {
             $websites = array();
         }
     } catch (PDOException $e) {
         throw $e;
     }
     $widget = new OnpubWidgetHeader("Section " . $this->osection->ID . " - " . $this->osection->name, ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="post">');
     en('<div>');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     if ($this->osection->name === NULL) {
         en('<h3 class="onpub-field-header">Name</h3><p><input type="text" maxlength="255" size="40" name="name" value=""> <img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'exclamation.png" align="top" alt="Required field" title="Required field"></p>');
     } else {
         en('<h3 class="onpub-field-header">Name</h3><p><input type="text" maxlength="255" size="40" name="name" value="' . htmlentities($this->osection->name) . '"></p>');
     }
     en('</div>');
     en('<div class="yui3-u-1-2">');
     if ($this->visible !== NULL) {
         en('<h3 class="onpub-field-header">Visibility</h3>');
         en('<p><input type="checkbox" id="id_visible" name="visible" value="1" checked="checked"> <label for="id_visible">De-select to hide this section from the Frontend.</label></p>');
     } else {
         en('<h3 class="onpub-field-header">Visibility</h3>');
         en('<p><input type="checkbox" id="id_visible" name="visible" value="1"> <label for="id_visible">Select to show this section on the Frontend.</label></p>');
     }
     en('</div>');
     en('</div>');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     if ($this->osection->parentID) {
         $sectionIDs = array($this->osection->parentID);
     } else {
         $sectionIDs = array();
     }
     $widget = new OnpubWidgetSections();
     $widget->sectionIDs = $sectionIDs;
     $widget->websites = array($website);
     $widget->osections = $osections;
     $widget->heading = "Parent Section";
     $widget->multiple = FALSE;
     $widget->fieldName = "parentID";
     $widget->osection = $this->osection;
     $widget->display();
     en('</div>');
     en('<div class="yui3-u-1-2">');
     en('<h3 class="onpub-field-header">Website</h3><p><a href="index.php?onpub=EditWebsite&amp;websiteID=' . $website->ID . '" title="Edit">' . $website->name . '</a></p>');
     en('</div>');
     en('</div>');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     if ($numOfArticles) {
         $widget = new OnpubWidgetArticles($this->pdo, $this->osection);
         $widget->display();
     } else {
         en('<h3 class="onpub-field-header">Visible Articles</h3><p>');
         en('There are 0 articles in the database. <a href="index.php?onpub=NewArticle">New Article</a>.</p>');
     }
     en('</div>');
     en('<div class="yui3-u-1-2">');
     $widget = new OnpubWidgetImages("Image", $this->osection->imageID, $images);
     $widget->display();
     en('</div>');
     en('</div>');
     if ($this->osection->url) {
         $go = ' <a href="' . $this->osection->url . '" target="_blank"><img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'world_go.png" border="0" align="top" alt="Go" title="Go" width="16" height="16"></a>';
     } else {
         $go = '';
     }
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     en('<h3 class="onpub-field-header">Static Link</h3><p><small>The Frontend will link this section to the path or URL entered below.<br>Leave blank to use auto-generated Frontend URLs.</small><br><input type="text" maxlength="255" size="40" name="url" value="' . htmlentities($this->osection->url) . '">' . $go . '</p>');
     en('</div>');
     en('<div class="yui3-u-1-2">');
     if (sizeof($wsmaps)) {
         $websitesMap = array();
         foreach ($websites as $website) {
             $websitesMap["{$website->ID}"] = $website;
         }
         $urlLabel = sizeof($wsmaps) > 1 ? 'URLs' : 'URL';
         en('<h3 class="onpub-field-header">Frontend ' . $urlLabel . '</h3>');
         en('<p>');
         en('<small>This section is displayed by the Frontend at the ' . $urlLabel . ' listed below.</small><br>');
         for ($i = 0; $i < sizeof($wsmaps); $i++) {
             $wsmap = $wsmaps[$i];
             $website = $websitesMap["{$wsmap->websiteID}"];
             $frontendURL = addTrailingSlash($website->url) . 'index.php?s=' . $wsmap->sectionID;
             en('&bull; <a href="' . $frontendURL . '" target="_blank">' . $frontendURL . '</a>');
             if ($i + 1 != sizeof($wsmaps)) {
                 en('<br>');
             }
         }
         en('</p>');
     }
     en('</div>');
     en('</div>');
     en('<div class="yui3-g">');
     en('<div class="yui3-u-1-2">');
     en('<h3 class="onpub-field-header">Created</h3><p>' . $this->osection->getCreated()->format('M j, Y g:i:s A') . '</p>');
     en('</div>');
     en('<div class="yui3-u-1-2">');
     en('<h3 class="onpub-field-header">Modified</h3><p>' . $this->osection->getModified()->format('M j, Y g:i:s A') . '</p>');
     en('</div>');
     en('</div>');
     en('<input type="submit" value="Save" id="selectAll"> <input type="button" value="Delete" id="deleteSection">');
     en('<input type="hidden" name="onpub" value="EditSectionProcess">');
     en('<input type="hidden" name="sectionID" value="' . $this->osection->ID . '">');
     en('<input type="hidden" name="websiteID" value="' . $this->osection->websiteID . '">');
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #27
0
ファイル: OnpubEditSections.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $osections = new OnpubSections($this->pdo);
     $owebsites = new OnpubWebsites($this->pdo);
     $this->fullTextSearch = "NA";
     $counter = 0;
     $currentPage = 1;
     if ($this->page) {
         $currentPage = $this->page;
     }
     if ($this->orderBy && $this->order) {
         if ($this->keywords) {
             try {
                 $queryOptions = new OnpubQueryOptions();
                 $queryOptions->orderBy = $this->orderBy;
                 $queryOptions->order = $this->order;
                 $sections = $osections->search($this->keywords, $queryOptions);
             } catch (PDOException $e) {
                 $widget = new OnpubWidgetPDOException($e);
                 $widget->display();
                 return;
             }
             $totalSections = sizeof($sections);
         } else {
             if ($this->websiteID) {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->orderBy = $this->orderBy;
                     $queryOptions->order = $this->order;
                     $sections = $osections->select($queryOptions, $this->websiteID);
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
                 $totalSections = sizeof($sections);
             } else {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->orderBy = $this->orderBy;
                     $queryOptions->order = $this->order;
                     $queryOptions->setPage($currentPage, ONPUBGUI_PDO_ROW_LIMIT);
                     $sections = $osections->select($queryOptions);
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
                 try {
                     $totalSections = $osections->count();
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
             }
         }
     } else {
         if ($this->keywords) {
             try {
                 $queryOptions = new OnpubQueryOptions();
                 $queryOptions->orderBy = "created";
                 $queryOptions->order = "DESC";
                 $sections = $osections->search($this->keywords, $queryOptions);
             } catch (PDOException $e) {
                 $widget = new OnpubWidgetPDOException($e);
                 $widget->display();
                 return;
             }
             $totalSections = sizeof($sections);
         } else {
             if ($this->websiteID) {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->orderBy = "created";
                     $queryOptions->order = "DESC";
                     $sections = $osections->select($queryOptions, $this->websiteID);
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
                 $totalSections = sizeof($sections);
             } else {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->orderBy = "created";
                     $queryOptions->order = "DESC";
                     $queryOptions->setPage($currentPage, ONPUBGUI_PDO_ROW_LIMIT);
                     $sections = $osections->select($queryOptions);
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
                 try {
                     $totalSections = $osections->count();
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
             }
         }
     }
     $widget = new OnpubWidgetHeader("Sections", ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="get">');
     en('<div>');
     if ($totalSections) {
         if (!$this->keywords) {
             $widget = new OnpubWidgetSelectWebsite($this->pdo, $this->websiteID);
             $widget->display();
         }
         $widget = new OnpubWidgetPaginator($totalSections, $this->orderBy, $this->order, $this->page, $this->keywords, $this->fullTextSearch, "websiteID", $this->websiteID, "EditSections");
         $widget->display();
         en('<table>');
         en('<tr>');
         //en('<td></td>');
         if ($this->keywords) {
             $this->keywords = urlencode($this->keywords);
             if ($this->fullTextSearch) {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=ASC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "name":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=name&amp;order=DESC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             } else {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=ASC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "name":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=name&amp;order=DESC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             }
             $this->keywords = urldecode($this->keywords);
         } else {
             if ($this->websiteID) {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC&websiteID=' . $this->websiteID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC&websiteID=' . $this->websiteID . '">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC&websiteID=' . $this->websiteID . '">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=ASC&websiteID=' . $this->websiteID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC&websiteID=' . $this->websiteID . '">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC&websiteID=' . $this->websiteID . '">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "name":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC&websiteID=' . $this->websiteID . '">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=DESC&websiteID=' . $this->websiteID . '">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC&websiteID=' . $this->websiteID . '">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC&websiteID=' . $this->websiteID . '">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC&websiteID=' . $this->websiteID . '">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC&websiteID=' . $this->websiteID . '">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC&websiteID=' . $this->websiteID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC&websiteID=' . $this->websiteID . '">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC&websiteID=' . $this->websiteID . '">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC&websiteID=' . $this->websiteID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC&websiteID=' . $this->websiteID . '">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=ASC&websiteID=' . $this->websiteID . '">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC&websiteID=' . $this->websiteID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC&websiteID=' . $this->websiteID . '">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=ASC&websiteID=' . $this->websiteID . '">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             } else {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=ASC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "name":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=DESC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=name&amp;order=ASC">Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header">Website</span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditSections&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             }
         }
         en('</tr>');
         if ($this->keywords || $this->websiteID) {
             $index = ($currentPage - 1) * ONPUBGUI_PDO_ROW_LIMIT;
         } else {
             $index = 0;
         }
         for ($i = 0; $i < ONPUBGUI_PDO_ROW_LIMIT && $index < sizeof($sections); $i++) {
             $section = $sections[$index];
             $this->ID = $sections[$index]->ID;
             $name = $sections[$index]->name;
             $created = $sections[$index]->getCreated()->format("M j, Y");
             $website = $owebsites->get($sections[$index]->websiteID);
             $websiteName = $website->name;
             if ($section->parentID) {
                 $names = array();
                 $names[] = $name;
                 $name = "";
                 while ($section->parentID) {
                     $section = $section->parent;
                     $names[] = $section->name;
                 }
                 $names = array_reverse($names);
                 for ($j = 0; $j < sizeof($names); $j++) {
                     if ($j == 0) {
                         $name .= $names[$j];
                     } else {
                         $name .= ' &ndash; ' . $names[$j];
                     }
                 }
             }
             en('<tr valign="top">');
             //en('<td align="right"><input type="checkbox" name="sectionIDs[]" value="' . $this->ID . '"></td>');
             switch ($this->order) {
                 case "ASC":
                     switch ($counter) {
                         case 0:
                             en('<td class="onpub-highlight1" align="right">' . $this->ID . '</td>');
                             en('<td class="onpub-highlight1" align="left"><a href="index.php?onpub=EditSection&amp;sectionID=' . $this->ID . '" title="Edit">' . $name . '</a></td>');
                             en('<td class="onpub-highlight1" align="left">' . $websiteName . '</td>');
                             en('<td class="onpub-highlight1" align="left">' . $created . '</td>');
                             break;
                         case 1:
                             en('<td class="onpub-highlight2" align="right">' . $this->ID . '</td>');
                             en('<td class="onpub-highlight2" align="left"><a href="index.php?onpub=EditSection&amp;sectionID=' . $this->ID . '" title="Edit">' . $name . '</a></td>');
                             en('<td class="onpub-highlight2" align="left">' . $websiteName . '</td>');
                             en('<td class="onpub-highlight2" align="left">' . $created . '</td>');
                             break;
                     }
                     break;
                 case "DESC":
                     switch ($counter) {
                         case 0:
                             en('<td class="onpub-highlight1" align="right">' . $this->ID . '</td>');
                             en('<td class="onpub-highlight1" align="left"><a href="index.php?onpub=EditSection&amp;sectionID=' . $this->ID . '" title="Edit">' . $name . '</a></td>');
                             en('<td class="onpub-highlight1" align="left">' . $websiteName . '</td>');
                             en('<td class="onpub-highlight1" align="left">' . $created . '</td>');
                             break;
                         case 1:
                             en('<td class="onpub-highlight2" align="right">' . $this->ID . '</td>');
                             en('<td class="onpub-highlight2" align="left"><a href="index.php?onpub=EditSection&amp;sectionID=' . $this->ID . '" title="Edit">' . $name . '</a></td>');
                             en('<td class="onpub-highlight2" align="left">' . $websiteName . '</td>');
                             en('<td class="onpub-highlight2" align="left">' . $created . '</td>');
                             break;
                     }
                     break;
                 default:
                     switch ($counter) {
                         case 0:
                             en('<td class="onpub-highlight1" align="right">' . $this->ID . '</td>');
                             en('<td class="onpub-highlight1" align="left"><a href="index.php?onpub=EditSection&amp;sectionID=' . $this->ID . '" title="Edit">' . $name . '</a></td>');
                             en('<td class="onpub-highlight1" align="left">' . $websiteName . '</td>');
                             en('<td class="onpub-highlight1" align="left">' . $created . '</td>');
                             break;
                         case 1:
                             en('<td class="onpub-highlight2" align="right">' . $this->ID . '</td>');
                             en('<td class="onpub-highlight2" align="left"><a href="index.php?onpub=EditSection&amp;sectionID=' . $this->ID . '" title="Edit">' . $name . '</a></td>');
                             en('<td class="onpub-highlight2" align="left">' . $websiteName . '</td>');
                             en('<td class="onpub-highlight2" align="left">' . $created . '</td>');
                             break;
                     }
                     break;
             }
             en('</tr>');
             if ($counter + 1 == 2) {
                 $counter = 0;
             } else {
                 $counter++;
             }
             $index++;
         }
         en('</table>');
     } else {
         if ($this->keywords) {
             en('<p>Your search did not yield any results. <a href="javascript:clearSearchField(); submitForm();">Display all sections</a>.</p>');
         } else {
             if ($this->websiteID) {
                 $widget = new OnpubWidgetSelectWebsite($this->pdo, $this->websiteID);
                 $widget->display();
                 br(2);
                 en('<p>There are 0 sections in the selected website. <a href="index.php?onpub=EditSections&amp;websiteID=">Display all sections</a>.</p>');
             } else {
                 en('<p>There are 0 sections in the database. <a href="index.php?onpub=NewSection">New Section</a>.</p>');
             }
         }
     }
     if ($totalSections) {
         $widget = new OnpubWidgetStats($totalSections, $this->keywords, $this->websiteID, "Section", "Website");
         $widget->display();
     }
     en('<input type="hidden" name="onpub" value="EditSections">');
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #28
0
ファイル: OnpubEditImages.php プロジェクト: onpubcom/onpub
 public function display()
 {
     $oimages = new OnpubImages($this->pdo);
     $owebsites = new OnpubWebsites($this->pdo);
     $this->fullTextSearch = "NA";
     $counter = 0;
     $currentPage = 1;
     if ($this->page) {
         $currentPage = $this->page;
     }
     if ($this->orderBy && $this->order) {
         if ($this->keywords) {
             try {
                 $queryOptions = new OnpubQueryOptions();
                 $queryOptions->orderBy = $this->orderBy;
                 $queryOptions->order = $this->order;
                 $images = $oimages->search($this->keywords, $queryOptions);
             } catch (PDOException $e) {
                 $widget = new OnpubWidgetPDOException($e);
                 $widget->display();
                 return;
             }
             $totalImages = sizeof($images);
         } else {
             if ($this->sectionID) {
             } else {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->orderBy = $this->orderBy;
                     $queryOptions->order = $this->order;
                     $queryOptions->setPage($currentPage, ONPUBGUI_PDO_ROW_LIMIT);
                     $images = $oimages->select($queryOptions);
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
                 try {
                     $totalImages = $oimages->count();
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
             }
         }
     } else {
         if ($this->keywords) {
             try {
                 $queryOptions = new OnpubQueryOptions();
                 $queryOptions->orderBy = "created";
                 $queryOptions->order = "DESC";
                 $images = $oimages->search($this->keywords, $queryOptions);
             } catch (PDOException $e) {
                 $widget = new OnpubWidgetPDOException($e);
                 $widget->display();
                 return;
             }
             $totalImages = sizeof($images);
         } else {
             if ($this->sectionID) {
             } else {
                 try {
                     $queryOptions = new OnpubQueryOptions();
                     $queryOptions->orderBy = "created";
                     $queryOptions->order = "DESC";
                     $queryOptions->setPage($currentPage, ONPUBGUI_PDO_ROW_LIMIT);
                     $images = $oimages->select($queryOptions);
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
                 try {
                     $totalImages = $oimages->count();
                 } catch (PDOException $e) {
                     $widget = new OnpubWidgetPDOException($e);
                     $widget->display();
                     return;
                 }
             }
         }
     }
     $widget = new OnpubWidgetHeader("Images", ONPUBAPI_SCHEMA_VERSION, $this->pdo);
     $widget->display();
     en('<form id="onpub-form" action="index.php" method="get">');
     en('<div>');
     en('<input type="hidden" name="onpub" value="EditImages">');
     if ($totalImages) {
         $widget = new OnpubWidgetPaginator($totalImages, $this->orderBy, $this->order, $this->page, $this->keywords, $this->fullTextSearch, "sectionID", $this->sectionID, "EditImages");
         $widget->display();
         en('<table>');
         en('<tr>');
         //en('<td></td>');
         if ($this->keywords) {
             $this->keywords = urlencode($this->keywords);
             if ($this->fullTextSearch) {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=ASC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "fileName":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=fileName&amp;order=DESC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;fullTextSearch=' . $this->fullTextSearch . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             } else {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=ASC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "fileName":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=fileName&amp;order=DESC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;keywords=' . $this->keywords . '&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             }
             $this->keywords = urldecode($this->keywords);
         } else {
             if ($this->sectionID) {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC&sectionID=' . $this->sectionID . '">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=ASC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC&sectionID=' . $this->sectionID . '">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "fileName":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=DESC&sectionID=' . $this->sectionID . '">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC&sectionID=' . $this->sectionID . '">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC&sectionID=' . $this->sectionID . '">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC&sectionID=' . $this->sectionID . '">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=ASC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC&sectionID=' . $this->sectionID . '">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC&sectionID=' . $this->sectionID . '">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=ASC&sectionID=' . $this->sectionID . '">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             } else {
                 switch ($this->orderBy) {
                     case "ID":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=ASC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     case "fileName":
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=DESC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                         }
                         break;
                     default:
                         switch ($this->order) {
                             case "ASC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=DESC">Created</a></span></td>');
                                 break;
                             case "DESC":
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                             default:
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=ID&amp;order=DESC">ID</a></span></td>');
                                 en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=fileName&amp;order=ASC">File Name</a></span></td>');
                                 en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&amp;orderBy=created&amp;order=ASC">Created</a></span></td>');
                                 break;
                         }
                         break;
                 }
             }
         }
         en('<td><span class="onpub-field-header">Preview</span></td>');
         en('</tr>');
         if ($this->keywords || $this->sectionID) {
             $index = ($currentPage - 1) * ONPUBGUI_PDO_ROW_LIMIT;
         } else {
             $index = 0;
         }
         $websites = array();
         for ($i = 0; $i < ONPUBGUI_PDO_ROW_LIMIT && $index < sizeof($images); $i++) {
             $image = $images[$index];
             $websiteID = $images[$index]->websiteID;
             $ID = $images[$index]->ID;
             $fileName = $images[$index]->fileName;
             $created = $images[$index]->getCreated()->format("M j, Y");
             if (!isset($websites[$websiteID])) {
                 $websites[$websiteID] = $owebsites->get($websiteID);
             }
             $thumbURL = OnpubImages::getThumbURL('src=' . urlencode($image->getFullPath()) . '&w=50&f=png');
             en('<tr valign="top">');
             //en('<td align="right"><input type="checkbox" name="imageIDs[]" value="' . $ID . '"></td>');
             switch ($this->order) {
                 case "ASC":
                     switch ($counter) {
                         case 0:
                             en('<td class="onpub-highlight1" align="right">' . $ID . '</td>');
                             en('<td class="onpub-highlight1" align="left"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit">' . $fileName . '</a></td>');
                             en('<td class="onpub-highlight1" align="left">' . $created . '</td>');
                             en('<td class="onpub-highlight1"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit"><img src="' . $thumbURL . '"></a></td>');
                             break;
                         case 1:
                             en('<td class="onpub-highlight2" align="right">' . $ID . '</td>');
                             en('<td class="onpub-highlight2" align="left"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit">' . $fileName . '</a></td>');
                             en('<td class="onpub-highlight2" align="left">' . $created . '</td>');
                             en('<td class="onpub-highlight2"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit"><img src="' . $thumbURL . '"></a></td>');
                             break;
                     }
                     break;
                 case "DESC":
                     switch ($counter) {
                         case 0:
                             en('<td class="onpub-highlight1" align="right">' . $ID . '</td>');
                             en('<td class="onpub-highlight1" align="left"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit">' . $fileName . '</a></td>');
                             en('<td class="onpub-highlight1" align="left">' . $created . '</td>');
                             en('<td class="onpub-highlight1"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit"><img src="' . $thumbURL . '"></a></td>');
                             break;
                         case 1:
                             en('<td class="onpub-highlight2" align="right">' . $ID . '</td>');
                             en('<td class="onpub-highlight2" align="left"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit">' . $fileName . '</a></td>');
                             en('<td class="onpub-highlight2" align="left">' . $created . '</td>');
                             en('<td class="onpub-highlight2"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit"><img src="' . $thumbURL . '"></a></td>');
                             break;
                     }
                     break;
                 default:
                     switch ($counter) {
                         case 0:
                             en('<td class="onpub-highlight1" align="right">' . $ID . '</td>');
                             en('<td class="onpub-highlight1" align="left"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit">' . $fileName . '</a></td>');
                             en('<td class="onpub-highlight1" align="left">' . $created . '</td>');
                             en('<td class="onpub-highlight1"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit"><img src="' . $thumbURL . '"></a></td>');
                             break;
                         case 1:
                             en('<td class="onpub-highlight2" align="right">' . $ID . '</td>');
                             en('<td class="onpub-highlight2" align="left"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit">' . $fileName . '</a></td>');
                             en('<td class="onpub-highlight2" align="left">' . $created . '</td>');
                             en('<td class="onpub-highlight2"><a href="index.php?onpub=EditImage&amp;imageID=' . $ID . '" title="Edit"><img src="' . $thumbURL . '"></a></td>');
                             break;
                     }
                     break;
             }
             en('</tr>');
             if ($counter + 1 == 2) {
                 $counter = 0;
             } else {
                 $counter++;
             }
             $index++;
         }
         en('</table>');
     } else {
         if ($this->keywords) {
             en('<p>Your search did not yield any results. <a href="javascript:clearSearchField(); submitForm();">Display all images</a>.</p>');
         } else {
             if ($this->sectionID) {
             } else {
                 en('<p>There are 0 images on file. <a href="index.php?onpub=UploadImages">Upload Images</a>.</p>');
             }
         }
     }
     if ($totalImages) {
         $widget = new OnpubWidgetStats($totalImages, $this->keywords, $this->sectionID, "Image", "");
         $widget->display();
     }
     en('</div>');
     en('</form>');
     $widget = new OnpubWidgetFooter();
     $widget->display();
 }
コード例 #29
0
ファイル: example.php プロジェクト: soska/csml
<?php

include "csml.php";
t('div#container');
t('div#content');
t('div#header');
en('This is the header', array('h1.page-title', 'a.link[href="http://duperrific.com" rel="friend"]'), '', INLINE);
t('/div');
t('ul#main.navigation');
en('Home', array('li', 'a[href="/home"]'));
en('About', array('li', 'a[href="/about"]'));
en('Login', array('li', 'a[href="/login"]'));
en('Signup', array('li', 'a[href="/signup"]'));
t('/');
// useful for links
$selectors = array('ul.navigation', 'li', 'a.button[href="http://google.com"]');
en("Go to Google", $selectors);
// output: <ul class="navigation><li><a href="http://google.com"" class="button">Go to Google</a></li></ul>
t('/div#content');
t('/div#container');
コード例 #30
0
ファイル: amidala.php プロジェクト: buganini/amidala
function proc($s)
{
    if ($_POST['processs'] == 'en') {
        $bat = explode(",", $_POST['batch2']);
        for ($i = 0; $i < count($bat); ++$i) {
            list($a, $m) = explode("-", $bat[$i]);
            if (trim($a) == "e") {
                $s = en(trim($m), $s);
            }
            if (trim($a) == "d") {
                $s = de(trim($m), $s);
            }
        }
    }
    if ($_POST['processs'] == 'de') {
        $bat = explode(",", $_POST['batch2']);
        for ($i = count($bat) - 1; $i >= 0; $i--) {
            list($a, $m) = explode("-", $bat[$i]);
            if (trim($a) == "e") {
                $s = de(trim($m), $s);
            }
            if (trim($a) == "d") {
                $s = en(trim($m), $s);
            }
        }
    }
    return $s;
}