/**
  * @param BlockController $block
  * @param DecoratorParams $params
  *
  * @return mixed
  */
 public function render(BlockController $block, DecoratorParams $params)
 {
     $title = $block->getTitle();
     $header = '';
     if ($title) {
         $header = '<div class="unit-header"><div class="unit-title"><span>' . $title . '</span></div></div>';
     }
     return '<div class="unit ' . $block->getCssClassName() . '">' . $header . '<div class="unit-content">' . $block->getContent() . '</div></div>';
 }
 /**
  * @param BlockController $block
  * @param DecoratorParams $params
  *
  * @return mixed
  */
 public function render(BlockController $block, DecoratorParams $params)
 {
     $title = $block->getTitle();
     $header = '';
     if ($title) {
         $header = '<div class="panel-header"><div class="panel-header"><span>' . $title . '</span></div></div>';
     }
     return '<div class="panel ' . $params->get('scheme') . ' ' . $block->getCssClassName() . '">' . $header . '<div class="panel-body">' . $block->getContent() . '</div></div>';
 }
Esempio n. 3
0
		public function save($args) {		
			$args['fOnstateID'] = ($args['fOnstateID'] != '') ? $args['fOnstateID'] : 0;
			$args['fID'] = ($args['fID'] != '') ? $args['fID'] : 0;
			$args['maxWidth'] = (intval($args['maxWidth']) > 0) ? intval($args['maxWidth']) : 0;
			$args['maxHeight'] = (intval($args['maxHeight']) > 0) ? intval($args['maxHeight']) : 0;
			parent::save($args);
		}
 public function save($args)
 {
     $db = Loader::db();
     $args['showArrows'] = intval($args['showArrows']);
     $args['loopSequence'] = intval($args['loopSequence']);
     parent::save($args);
 }
Esempio n. 5
0
		function save($data) { 
			$args['fID']    = intval($data['fID']);	
			$args['width']  = (intval($data['width'])>0)  ? intval($data['width'])  : 425;
			$args['height'] = (intval($data['height'])>0) ? intval($data['height']) : 334;		
			
			parent::save($args);
		}				
Esempio n. 6
0
 public function save($args)
 {
     $args['field_2_image_fID'] = empty($args['field_2_image_fID']) ? 0 : $args['field_2_image_fID'];
     $args['field_3_image_fID'] = empty($args['field_3_image_fID']) ? 0 : $args['field_3_image_fID'];
     $args['field_4_image_fID'] = empty($args['field_4_image_fID']) ? 0 : $args['field_4_image_fID'];
     $args['field_5_image_fID'] = empty($args['field_5_image_fID']) ? 0 : $args['field_5_image_fID'];
     parent::save($args);
 }
Esempio n. 7
0
		function save($data) { 
			$args['title'] = isset($data['title']) ? trim($data['title']) : '';
			$args['videoURL'] = isset($data['videoURL']) ? trim($data['videoURL']) : '';
			$args['vHeight'] = isset($data['vHeight']) ? trim($data['vHeight']) : '';
			$args['vWidth'] = isset($data['vWidth']) ? trim($data['vWidth']) : '';
			$args['vPlayer'] = ($data['vPlayer']==1) ? 1 : 0;
			parent::save($args);
		}
Esempio n. 8
0
 function save($args)
 {
     $args['displayPagesIncludeSelf'] = $args['displayPagesIncludeSelf'] ? 1 : 0;
     $args['displayPagesCID'] = $args['displayPagesCID'] ? $args['displayPagesCID'] : 0;
     $args['displaySubPageLevelsNum'] = $args['displaySubPageLevelsNum'] > 0 ? $args['displaySubPageLevelsNum'] : 0;
     $args['displayUnavailablePages'] = $args['displayUnavailablePages'] ? 1 : 0;
     parent::save($args);
 }
Esempio n. 9
0
 public function save($args)
 {
     $ak = $this->loadAttribute();
     $c = Page::getByID($_REQUEST['cID'], 'RECENT');
     $nvc = $c->getVersionToModify();
     $ak->saveAttributeForm($nvc);
     $nvc->refreshCache();
     parent::save($args);
 }
Esempio n. 10
0
		function save($data) { 
			$args['url'] = isset($data['url']) ? $data['url'] : '';
			$args['dateFormat'] = $data['dateFormat'];
			$args['itemsToDisplay'] = (intval($data['itemsToDisplay'])>0) ? intval($data['itemsToDisplay']) : 5 ;
			$args['showSummary'] = ($data['showSummary']==1) ? 1 : 0;
			$args['launchInNewWindow'] = ($data['launchInNewWindow']==1) ? 1 : 0;
			$args['title'] = isset($data['title']) ? $data['title'] : '';
			parent::save($args);
		}
Esempio n. 11
0
 public function save($values)
 {
     $repository = array("title" => $values["title"], "user" => $values["user"]);
     $db = Loader::db();
     $db->query("DELETE FROM btGithubRepositories WHERE bID = ?", array(intval($this->bID)));
     $repos = $values["repos"];
     foreach ($repos as $key => $rp) {
         $db->query("INSERT INTO btGithubRepositories (bID, repos) VALUES (?, ?)", array($this->bID, $rp));
     }
     parent::save($repository);
 }
Esempio n. 12
0
 public function save($args)
 {
     $args['field_2_wysiwyg_content'] = $this->translateTo($args['field_2_wysiwyg_content']);
     $args['field_3_wysiwyg_content'] = $this->translateTo($args['field_3_wysiwyg_content']);
     $args['field_4_wysiwyg_content'] = $this->translateTo($args['field_4_wysiwyg_content']);
     $args['field_5_wysiwyg_content'] = $this->translateTo($args['field_5_wysiwyg_content']);
     $args['field_6_wysiwyg_content'] = $this->translateTo($args['field_6_wysiwyg_content']);
     $args['field_7_wysiwyg_content'] = $this->translateTo($args['field_7_wysiwyg_content']);
     $args['field_8_wysiwyg_content'] = $this->translateTo($args['field_8_wysiwyg_content']);
     parent::save($args);
 }
Esempio n. 13
0
		function delete() {
			$ip = Loader::helper('validation/ip');
			if (!$ip->check()) {
				$this->set('invalidIP', $ip->getErrorMessage());			
				return;
			}
			$c = Page::getCurrentPage();
			$E = new GuestBookBlockEntry($this->bID, $c->getCollectionID());
			$bo = $this->getBlockObject();
			$E->removeAllEntries( $c->getCollectionID() );
			parent::delete();
		}
Esempio n. 14
0
 public function save($data)
 {
     $db = Loader::db();
     $db->query("DELETE FROM btBuilderPackage WHERE bID = ?", array(intval($this->bID)));
     $fsIDs = $this->post("fsID");
     foreach ($fsIDs as $key => $fsID) {
         $db->query("INSERT INTO btBuilderPackage VALUES (?, ?, ?)", array($this->bID, $fsID, $key));
     }
     $u = new User();
     $data["uID"] = $u->getUserID();
     parent::save($data);
 }
Esempio n. 15
0
 public function save($data)
 {
     $args['title'] = isset($data['title']) ? trim($data['title']) : '';
     $args['location'] = isset($data['location']) ? trim($data['location']) : '';
     $args['zoom'] = intval($data['zoom']) >= 0 && intval($data['zoom']) <= 21 ? intval($data['zoom']) : 14;
     if (strlen($args['location']) > 0) {
         $coords = $this->lookupLatLong($args['location']);
         $args['latitude'] = floatval($coords['lat']);
         $args['longitude'] = floatval($coords['lng']);
     } else {
         $args['latitude'] = 0;
         $args['longitude'] = 0;
     }
     parent::save($args);
 }
Esempio n. 16
0
 /**
  * @throws Exception
  *
  * @return BlockController
  */
 public function getController()
 {
     if ($this->controller) {
         return $this->controller;
     }
     foreach (array_reverse(ClassInfo::ancestry($this->class)) as $blockClass) {
         $controllerClass = "{$blockClass}_Controller";
         if (class_exists($controllerClass)) {
             break;
         }
     }
     if (!class_exists($controllerClass)) {
         throw new Exception("Could not find controller class for {$this->classname}");
     }
     $this->controller = Injector::inst()->create($controllerClass, $this);
     $this->controller->init();
     return $this->controller;
 }
Esempio n. 17
0
		public function save($args) {		
			$args['fOnstateID'] = ($args['fOnstateID'] != '') ? $args['fOnstateID'] : 0;
			$args['fID'] = ($args['fID'] != '') ? $args['fID'] : 0;
			$args['maxWidth'] = (intval($args['maxWidth']) > 0) ? intval($args['maxWidth']) : 0;
			$args['maxHeight'] = (intval($args['maxHeight']) > 0) ? intval($args['maxHeight']) : 0;
			switch (intval($args['linkType'])) {
				case 1:
					$args['externalLink'] = '';
					break;
				case 2:
					$args['internalLinkCID'] = 0;
					break;
				default:
					$args['externalLink'] = '';
					$args['internalLinkCID'] = 0;
					break;
			}
			unset($args['linkType']); //this doesn't get saved to the database (it's only for UI usage)
			parent::save($args);
		}
Esempio n. 18
0
 function save($args)
 {
     /* Flush any existing Timeline Components */
     $this->deleteExistingUserOrHashSettings();
     //if any exist, we remove them
     /* Flush the cache */
     $this->flushFullTimelineCache();
     /* Fix the checkbox fields */
     $args = $this->fixCheckboxFields($args);
     $userOrHash = empty($_POST['userOrHash']) ? array() : $_POST['userOrHash'];
     $userOrHashValues = empty($_POST['userOrHashValue']) ? array() : $_POST['userOrHashValue'];
     /*
      * Get the tokens and setup the default Timeline Component if user is
      * authenticating or reauthenticating a Twitter account.
      */
     if (isset($_POST['oAuthPIN'])) {
         $twitterObj = $this->getTwitterOAuthObject($_POST['oAuthRequestToken'], $_POST['oAuthRequestTokenSecret']);
         $access_token = $twitterObj->getAccessToken($_POST['oAuthPIN']);
         $args['oAuthToken'] = $access_token['oauth_token'];
         $args['oAuthTokenSecret'] = $access_token['oauth_token_secret'];
         $args['userName'] = $access_token['screen_name'];
         $args['userID'] = $access_token['user_id'];
         array_unshift($userOrHash, 1);
         array_unshift($userOrHashValues, $args['userName']);
     }
     if (!empty($userOrHash) && !empty($userOrHashValues)) {
         $userOrHashSettingsArray = array();
         /* Combine the two arrays eliminating any items where either array value is null */
         foreach ($userOrHash as $post_array_key => $post_array_value) {
             if (!empty($post_array_value) && !empty($userOrHashValues[$post_array_key])) {
                 array_push($userOrHashSettingsArray, array($post_array_value => $userOrHashValues[$post_array_key]));
             }
         }
         $this->saveUserOrHashSettingsArray($userOrHashSettingsArray);
     }
     parent::save($args);
 }
Esempio n. 19
0
 public function save($args)
 {
     parent::save($args);
 }
Esempio n. 20
0
 function save($args)
 {
     $args['content'] = Loader::helper('content')->translateTo($args['content']);
     parent::save($args);
 }
Esempio n. 21
0
 function save($args)
 {
     parent::save($args);
     $db = Loader::db();
     if (!is_array($args['survivingOptionNames'])) {
         $args['survivingOptionNames'] = array();
     }
     $slashedArgs = array();
     foreach ($args['survivingOptionNames'] as $arg) {
         $slashedArgs[] = addslashes($arg);
     }
     $db->query("DELETE FROM btSurveyOptions WHERE optionName NOT IN ('" . implode("','", $slashedArgs) . "') AND bID = " . intval($this->bID));
     if (is_array($args['pollOption'])) {
         $displayOrder = 0;
         foreach ($args['pollOption'] as $optionName) {
             $v1 = array($this->bID, $optionName, $displayOrder);
             $q1 = "insert into btSurveyOptions (bID, optionName, displayOrder) values (?, ?, ?)";
             $db->query($q1, $v1);
             $displayOrder++;
         }
     }
     $query = "DELETE FROM btSurveyResults \n\t\t\tWHERE optionID NOT IN (\n\t\t\t\tSELECT optionID FROM btSurveyOptions WHERE bID = {$this->bID}\n\t\t\t\t) \n\t\t\tAND bID = {$this->bID} ";
     $db->query($query);
 }
Esempio n. 22
0
 public function save($data)
 {
     $args['content'] = isset($data['content']) ? $data['content'] : '';
     parent::save($args);
 }
Esempio n. 23
0
 function delete()
 {
     $db = Loader::db();
     $deleteData['questionsIDs'] = array();
     $deleteData['strandedAnswerSetIDs'] = array();
     $miniSurvey = new MiniSurvey();
     $info = $miniSurvey->getMiniSurveyBlockInfo($this->bID);
     //get all answer sets
     $q = "SELECT asID FROM {$this->btAnswerSetTablename} WHERE questionSetId = " . intval($info['questionSetId']);
     $answerSetsRS = $db->query($q);
     //delete the questions
     $deleteData['questionsIDs'] = $db->getAll("SELECT qID FROM {$this->btQuestionsTablename} WHERE questionSetId = " . intval($info['questionSetId']) . ' AND bID=' . intval($this->bID));
     foreach ($deleteData['questionsIDs'] as $questionData) {
         $db->query("DELETE FROM {$this->btQuestionsTablename} WHERE qID=" . intval($questionData['qID']));
     }
     //delete left over answers
     $strandedAnswerIDs = $db->getAll('SELECT fa.aID FROM `btFormAnswers` AS fa LEFT JOIN btFormQuestions as fq ON fq.msqID=fa.msqID WHERE fq.msqID IS NULL');
     foreach ($strandedAnswerIDs as $strandedAnswerIDs) {
         $db->query('DELETE FROM `btFormAnswers` WHERE aID=' . intval($strandedAnswer['aID']));
     }
     //delete the left over answer sets
     $deleteData['strandedAnswerSetIDs'] = $db->getAll('SELECT aset.asID FROM btFormAnswerSet AS aset LEFT JOIN btFormAnswers AS fa ON aset.asID=fa.asID WHERE fa.asID IS NULL');
     foreach ($deleteData['strandedAnswerSetIDs'] as $strandedAnswerSetIDs) {
         $db->query('DELETE FROM btFormAnswerSet WHERE asID=' . intval($strandedAnswerSetIDs['asID']));
     }
     //delete the form block
     $q = "delete from {$this->btTable} where bID = '{$this->bID}'";
     $r = $db->query($q);
     parent::delete();
     return $deleteData;
 }
Esempio n. 24
0
 function save($data)
 {
     $args['title'] = isset($data['title']) ? $data['title'] : '';
     $args['buttonText'] = isset($data['buttonText']) ? $data['buttonText'] : '';
     $args['baseSearchPath'] = isset($data['baseSearchPath']) ? $data['baseSearchPath'] : '';
     if ($args['baseSearchPath'] == 'OTHER' && intval($data['searchUnderCID']) > 0) {
         $customPathC = Page::getByID(intval($data['searchUnderCID']));
         if (!$customPathC) {
             $args['baseSearchPath'] = '';
         } else {
             $args['baseSearchPath'] = $customPathC->getCollectionPath();
         }
     }
     if (trim($args['baseSearchPath']) == '/' || strlen(trim($args['baseSearchPath'])) == 0) {
         $args['baseSearchPath'] = '';
     }
     if (intval($data['postTo_cID']) > 0) {
         $args['postTo_cID'] = intval($data['postTo_cID']);
     } else {
         $args['postTo_cID'] = '';
     }
     $args['resultsURL'] = $data['externalTarget'] == 1 && strlen($data['resultsURL']) > 0 ? trim($data['resultsURL']) : '';
     parent::save($args);
 }
 function save($args)
 {
     // If we've gotten to the process() function for this class, we assume that we're in
     // the clear, as far as permissions are concerned (since we check permissions at several
     // points within the dispatcher)
     $db = Loader::db();
     $bID = $this->bID;
     $c = $this->getCollectionObject();
     if (is_object($c)) {
         $this->cID = $c->getCollectionID();
     }
     $args['num'] = $args['num'] > 0 ? $args['num'] : 0;
     $args['cThis'] = $args['cParentID'] == $this->cID ? '1' : '0';
     $args['cParentID'] = $args['cParentID'] == 'OTHER' ? $args['cParentIDValue'] : $args['cParentID'];
     $args['truncateSummaries'] = $args['truncateSummaries'] ? '1' : '0';
     $args['truncateTitles'] = $args['truncateTitles'] ? '1' : '0';
     $args['displayFeaturedOnly'] = $args['displayFeaturedOnly'] ? '1' : '0';
     $args['truncateChars'] = intval($args['truncateChars']);
     $args['truncateTitleChars'] = intval($args['truncateTitleChars']);
     $args['showDescriptions'] = $args['showDescriptions'] ? '1' : '0';
     parent::save($args);
 }
 function save($data)
 {
     $args['playback'] = isset($data['playback']) ? trim($data['playback']) : 'ORDER';
     $db = Loader::db();
     if ($data['type'] == 'FILESET' && $data['fsID'] > 0) {
         $args['fsID'] = $data['fsID'];
         $args['duration'] = $data['duration'][0];
         $args['fadeDuration'] = $data['fadeDuration'][0];
         $files = $db->getAll("SELECT fv.fID FROM FileSetFiles fsf, FileVersions fv WHERE fsf.fsID = " . $data['fsID'] . " AND fsf.fID = fv.fID AND fvIsApproved = 1");
         //delete existing images
         $db->query("DELETE FROM btSlideshowImg WHERE bID=" . intval($this->bID));
     } else {
         if ($data['type'] == 'CUSTOM' && count($data['imgFIDs'])) {
             $args['fsID'] = 0;
             //delete existing images
             $db->query("DELETE FROM btSlideshowImg WHERE bID=" . intval($this->bID));
             //loop through and add the images
             $pos = 0;
             foreach ($data['imgFIDs'] as $imgFID) {
                 if (intval($imgFID) == 0 || $data['fileNames'][$pos] == 'tempFilename') {
                     continue;
                 }
                 $vals = array(intval($this->bID), intval($imgFID), trim($data['url'][$pos]), intval($data['duration'][$pos]), intval($data['fadeDuration'][$pos]), intval($data['groupSet'][$pos]), intval($data['imgHeight'][$pos]), $pos);
                 $db->query("INSERT INTO btSlideshowImg (bID,fID,url,duration,fadeDuration,groupSet,imgHeight,position) values (?,?,?,?,?,?,?,?)", $vals);
                 $pos++;
             }
         }
     }
     parent::save($args);
 }
Esempio n. 27
0
 public function save($data)
 {
     $data['largeWidth'] = intval($data['largeWidth']);
     $data['largeHeight'] = intval($data['largeHeight']);
     $data['thumbWidth'] = intval($data['thumbWidth']);
     $data['thumbHeight'] = intval($data['thumbHeight']);
     $data['cropLarge'] = intval($data['cropLarge']) < 1 ? 0 : 1;
     //Watch out for the "-1" option
     parent::save($data);
 }
 function save($data)
 {
     $content = $this->translateTo($data['content']);
     $args['content'] = $content;
     parent::save($args);
 }
Esempio n. 29
0
 function save($data)
 {
     $args['title'] = isset($data['title']) ? trim($data['title']) : '';
     $args['videoURL'] = isset($data['videoURL']) ? trim($data['videoURL']) : '';
     parent::save($args);
 }
Esempio n. 30
0
 public function save($data)
 {
     $data['field_1_image_fID'] = empty($data['field_1_image_fID']) ? 0 : $data['field_1_image_fID'];
     $data['largeWidth'] = intval($data['largeWidth']);
     $data['largeHeight'] = intval($data['largeHeight']);
     $data['thumbWidth'] = intval($data['thumbWidth']);
     $data['thumbHeight'] = intval($data['thumbHeight']);
     $data['cropLarge'] = intval($data['cropLarge']) < 1 ? 0 : 1;
     //Watch out for the "-1" option
     parent::save($data);
 }