/**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  */
 function getHTML()
 {
     // Make a new Template object
     $path = $this->pathModuleRoot . 'templates/';
     $this->template = new Template($path);
     // Store the Name of thie series:
     $seriesManager = new RowManager_SeriesManager($this->seriesID);
     $this->template->set('seriesName', $seriesManager->getTitle());
     // store the field names being displayed
     $fieldNames = explode(',', page_SeasonList::DISPLAY_FIELDS);
     $this->template->set('dataFieldList', $fieldNames);
     // store the link values
     // $this->linkValues[ 'view' ] = 'add/new/href/data/here';
     $this->template->set('linkValues', $this->linkValues);
     // store the Link Column information
     $title = 'Episodes';
     $label = "view";
     $link = $this->linkValues['linkEpisode'];
     $fieldName = 'season_id';
     $this->addLinkColumn($title, $label, $link, $fieldName);
     $this->template->set('linkColumns', $this->linkColumns);
     // store Data to display as an Array
     $this->template->set('dataList', $this->listManager->getDataList());
     // now load and return the template HTML
     return $this->template->fetch('07_page_SeasonList.tpl');
 }
Esempio n. 2
0
// set default error Message
$titleError = '';
/***
 *** Process the Data
 ***/
if (isset($_REQUEST['submit'])) {
    if ($newTitle != '') {
        $seriesManager->setTitle($newTitle);
        $seriesManager->updateDBTable();
    } else {
        $titleError = 'Title can\'t be empty';
    }
}
/***
 *** get HTML for display
 ***/
// Now we create a Template object
// NOTE: (optional parameter is to set the path to your template file )
// ex   $template = new Template( "path/to/template/files/here.php" );
// if you don't set it, it assumes the template is in the same directory
// as your script.
//
$template = new Template();
// Now we pass/set the values of variables in the Template
// 1st parameter is the name of the variable as it will be called in the template
// 2nd parameter is the current variable that you want to pass in
$template->set('formAction', 'ex_SeriesEdit.php?seriesID=' . $seriesID);
$template->set('title', $seriesManager->getTitle());
$template->set('titleError', $titleError);
// now we get the HTML of the Template and display that for our page.
echo $template->fetch('ex_SeriesEdit.tpl');