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>'); } }
protected function article() { global $onpub_inc_article_info, $onpub_dir_phpthumb, $onpub_dir_manage, $onpub_dir_frontend, $onpub_inc_article_foot, $onpub_disp_friendly_urls; en('<div class="yui3-g">'); en('<div class="yui3-u-1 onpub-article" itemscope itemtype="http://schema.org/Article">'); if ($this->currentArticle) { if ($this->page == 'home') { $visibleSIDs = $this->getVisibleSIDs(); $url = ''; if ($this->currentArticle->url) { $url = $this->friendlyURLs($this->currentArticle->url, true); } elseif (sizeof($visibleSIDs)) { if ($onpub_disp_friendly_urls) { $url = $this->generateFriendlyURL(NULL, $this->currentArticle, $visibleSIDs[0]); } else { $url = 'index.php?s=' . $visibleSIDs[0] . '&a=' . $this->currentArticle->ID; } } if ($url) { en('<h1 style="margin-right: 0;" itemprop="name"><a href="' . $url . '" itemprop="url">' . $this->currentArticle->title . '</a></h1>'); } else { en('<h1 style="margin-right: 0;" itemprop="name">' . $this->currentArticle->title . '</h1>'); } } else { en('<h1 style="margin-right: 0;" itemprop="name">' . $this->currentArticle->title . '</h1>'); } en('<div class="yui3-g">'); en('<div class="yui3-u-1-2">'); en('<p class="onpub-article-info">'); $created = $this->currentArticle->getCreated(); $modified = $this->currentArticle->getModified(); if (function_exists('date_diff')) { $diff = $created->diff($modified); if (sizeof($this->currentArticle->authors)) { $author = $this->currentArticle->authors[0]; if ($diff->days > 0) { en('By <span itemprop="author">' . $author->displayAs . '</span> on <time datetime="' . $created->format('Y-m-d') . '" itemprop="datePublished">' . $created->format('M j, Y') . '</time>. Updated: <time datetime="' . $modified->format('Y-m-d') . '" itemprop="dateModified">' . $modified->format('M j, Y') . '</time>.'); } else { en('By <span itemprop="author">' . $author->displayAs . '</span> on <time datetime="' . $created->format('Y-m-d') . '" itemprop="datePublished">' . $created->format('M j, Y') . '</time>.'); } } else { if ($diff->days > 0) { en('Published: <time datetime="' . $created->format('Y-m-d') . '" itemprop="datePublished">' . $created->format('M j, Y') . '</time>. Updated: <time datetime="' . $modified->format('Y-m-d') . '" itemprop="dateModified">' . $modified->format('M j, Y') . '</time>.'); } else { en('Published: <time datetime="' . $created->format('Y-m-d') . '" itemprop="datePublished">' . $created->format('M j, Y') . '</time>.'); } } } else { if (sizeof($this->currentArticle->authors)) { $author = $this->currentArticle->authors[0]; en('By <span itemprop="author">' . $author->displayAs . '</span> on ' . $created->format('M j, Y') . '. Updated: <time datetime="' . $modified->format('Y-m-d') . '" itemprop="dateModified">' . $modified->format('M j, Y') . '</time>.'); } else { en('Published: <time datetime="' . $created->format('Y-m-d') . '" itemprop="datePublished">' . $created->format('M j, Y') . '</time>. Updated: <time datetime="' . $modified->format('Y-m-d') . '" itemprop="dateModified">' . $modified->format('M j, Y') . '</time>.'); } } en('</p>'); en('</div>'); en('<div class="yui3-u-1-2">'); if (file_exists($onpub_inc_article_info)) { include $onpub_inc_article_info; } en('</div>'); en('</div>'); if ($this->currentArticle->imageID) { $this->currentArticle->image->website = $this->website; en('<img src="' . OnpubImages::getThumbURL('src=' . urlencode($this->currentArticle->image->getFullPath()) . '&w=400&f=png', $onpub_dir_phpthumb) . '" align="right" alt="' . $this->currentArticle->image->fileName . '" title="' . $this->currentArticle->image->description . '" itemprop="thumbnailUrl">'); } en('<div itemprop="articleBody">'); en($this->friendlyURLs($this->currentArticle->content)); en('</div>'); if ($this->loginStatus) { en('<div class="yui3-g" style="margin-top: 2em">'); en('<div class="yui3-u-1">'); en('<span class="onpub-edit">'); en('<a href="' . $onpub_dir_manage . 'index.php?onpub=EditArticle&articleID=' . $this->currentArticle->ID . '" target="_onpub"><img src="' . $onpub_dir_frontend . 'images/page_edit.png" width="16" height="16" alt="Edit this Article" title="Edit this Article"></a> ' . '<a href="' . $onpub_dir_manage . 'index.php?onpub=EditArticle&articleID=' . $this->currentArticle->ID . '" target="_onpub" title="Edit this Article">EDIT</a>'); en('</span>'); en('</div>'); en('</div>'); } if (file_exists($onpub_inc_article_foot)) { include $onpub_inc_article_foot; } } else { en('<h1>Article ' . $this->requestedArticleID . ' not found... <a href="index.php">Home</a></h1>'); } en('</div>'); en('</div>'); }
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&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=fileName&order=ASC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=created&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&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=ID&order=ASC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=fileName&order=ASC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=created&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&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=fileName&order=DESC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=created&order=DESC">Created</a></span></td>'); break; case "DESC": en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=fileName&order=ASC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=created&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&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=fileName&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&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=created&order=DESC">Created</a></span></td>'); break; case "DESC": en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=fileName&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&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=created&order=ASC">Created</a></span></td>'); break; default: en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=fileName&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&keywords=' . $this->keywords . '&fullTextSearch=' . $this->fullTextSearch . '&orderBy=created&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&keywords=' . $this->keywords . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=fileName&order=ASC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=created&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&keywords=' . $this->keywords . '&orderBy=ID&order=ASC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=fileName&order=ASC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=created&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&keywords=' . $this->keywords . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=fileName&order=DESC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=created&order=DESC">Created</a></span></td>'); break; case "DESC": en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=fileName&order=ASC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=created&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&keywords=' . $this->keywords . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=fileName&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&keywords=' . $this->keywords . '&orderBy=created&order=DESC">Created</a></span></td>'); break; case "DESC": en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=fileName&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&keywords=' . $this->keywords . '&orderBy=created&order=ASC">Created</a></span></td>'); break; default: en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&keywords=' . $this->keywords . '&orderBy=fileName&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&keywords=' . $this->keywords . '&orderBy=created&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&orderBy=ID&order=DESC§ionID=' . $this->sectionID . '">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=ASC§ionID=' . $this->sectionID . '">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=created&order=DESC§ionID=' . $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&orderBy=ID&order=ASC§ionID=' . $this->sectionID . '">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=ASC§ionID=' . $this->sectionID . '">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=created&order=DESC§ionID=' . $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&orderBy=ID&order=DESC§ionID=' . $this->sectionID . '">ID</a></span></td>'); en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=DESC§ionID=' . $this->sectionID . '">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=created&order=DESC§ionID=' . $this->sectionID . '">Created</a></span></td>'); break; case "DESC": en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=ID&order=DESC§ionID=' . $this->sectionID . '">ID</a></span></td>'); en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=ASC§ionID=' . $this->sectionID . '">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=created&order=DESC§ionID=' . $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&orderBy=ID&order=DESC§ionID=' . $this->sectionID . '">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=ASC§ionID=' . $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&orderBy=created&order=DESC§ionID=' . $this->sectionID . '">Created</a></span></td>'); break; case "DESC": en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=ID&order=DESC§ionID=' . $this->sectionID . '">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=ASC§ionID=' . $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&orderBy=created&order=ASC§ionID=' . $this->sectionID . '">Created</a></span></td>'); break; default: en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=ID&order=DESC§ionID=' . $this->sectionID . '">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=ASC§ionID=' . $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&orderBy=created&order=ASC§ionID=' . $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&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=ASC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=created&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&orderBy=ID&order=ASC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=ASC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=created&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&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=DESC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=created&order=DESC">Created</a></span></td>'); break; case "DESC": en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left" class="onpub-highlight2"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&order=ASC">File Name</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=created&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&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&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&orderBy=created&order=DESC">Created</a></span></td>'); break; case "DESC": en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&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&orderBy=created&order=ASC">Created</a></span></td>'); break; default: en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=ID&order=DESC">ID</a></span></td>'); en('<td align="left"><span class="onpub-field-header"><a href="index.php?onpub=EditImages&orderBy=fileName&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&orderBy=created&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&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&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&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&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&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&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&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&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&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&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&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&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(); }