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(); }
public function display() { $owebsites = new OnpubWebsites($this->pdo); try { $queryOptions = new OnpubQueryOptions(); $queryOptions->orderBy = "name"; $queryOptions->order = "ASC"; $websites = $owebsites->select($queryOptions); } catch (PDOException $e) { throw $e; } $widget = new OnpubWidgetHeader("Upload Images", ONPUBAPI_SCHEMA_VERSION, $this->pdo); $widget->display(); en('<form id="onpub-form" action="index.php" method="post" enctype="multipart/form-data">'); en('<div>'); en('<div class="yui3-g">'); en('<div class="yui3-u-1-2">'); if ($this->imageFiles === NULL) { en('<h3 class="onpub-field-header">Image File</h3><p><input type="file" size="30" name="imageFiles[]"> <img src="' . ONPUBGUI_IMAGE_DIRECTORY . 'exclamation.png" align="top" alt="Required field" title="Required field"></p>'); } else { en('<h3 class="onpub-field-header">Image File</h3><p><input type="file" size="30" name="imageFiles[]"></p>'); } en('</div>'); en('<div class="yui3-u-1-2">'); //en('<h3 class="onpub-field-header">Image File</h3><p><input type="file" size="30" name="imageFiles[]"></p>'); en('</div>'); en('</div>'); $widget = new OnpubWidgetWebsites($this->websiteID, $websites, "image"); $widget->display(); en('<input type="submit" value="Upload">'); en('<input type="hidden" name="onpub" value="UploadImagesProcess">'); en('</div>'); en('</form>'); $widget = new OnpubWidgetFooter(); $widget->display(); }