示例#1
0
 /**
  * Shows the editing view for a portfolio item.
  */
 public function update($args)
 {
     echo 'count($args): ' . count($args);
     echo ' - ID:' . $_POST['categoryID'];
     $vo = new PortfolioItemVO(0);
     $screenshots = $_POST['screenshot1'] . ',' . $_POST['screenshot2'] . ',' . $_POST['screenshot3'];
     $updatedData = array($_POST['title'], 'Harry Northover', $_POST['date'], $_POST['client'], $_POST['categoryID'], $_POST['briefDescription'], $_POST['description'], $_POST['casestudyID'], 'false', 'true', $screenshots, $_POST['previewImage'], $_POST['finalLink']);
     echo $this->registry->update->updateData(Types::PORTFOLIO_ITEMS_TABLE, $args[0], $vo->getTableRowNames(), $updatedData);
 }
示例#2
0
 public function parse($data)
 {
     /*
      * Assign the data returned from the PortfolioProxy.php to $this->databaseData.
      */
     $this->databaseData = $data;
     //echo '<p>PortfolioParser.php - Database Length: ' . $this->databaseData . '</p>';
     /*
      * Process through the data returned from the proxy.
      */
     while ($row = mysql_fetch_array($this->databaseData)) {
         //echo 'processing...';
         $object = new PortfolioItemVO($row['id']);
         $object->title($row['title']);
         $object->author('Harry Northover');
         $object->client($row['client']);
         $object->publishDate($row['publishDate']);
         $object->briefDescription(substr(strip_tags($row['description'], "<br>, <b>, <i>, <li>"), 0, 80) . '...');
         $object->description($row['description']);
         $object->prevImageURL($row['prevImageURL']);
         $object->caseStudyID($row['caseStudyID']);
         $object->workType($row['workType']);
         $object->finalURL($row['finalURL']);
         $screenshots = $row['screenshots'];
         $screenSArrays = explode(',', $screenshots);
         $object->screenshots($screenSArrays);
         if ($row['isPrivate'] == 'true') {
             $object->isPrivate(true);
         } else {
             if ($row['isPrivate'] == 'false') {
                 $object->isPrivate(false);
             } else {
                 /* If $row['keep_private'] is neither 'yes' or 'no' then set it to private by default. */
                 $object->isPrivate(true);
             }
         }
         /*
          * Push the new object to the array containing the parsed objects.
          */
         array_push($this->parsedData, $object);
     }
     //echo '<p>PortfolioParser.php - Array length: ' . count($this->parsedData) . '</p>';
     /*
      * Reverse the array so the oldest items are at
      * the start of the array, then return it.
      */
     return array_reverse($this->parsedData);
 }