Beispiel #1
0
 /**
  * Get the value of a column of the database table.
  * If the value was manipulated before with @b setValue than the manipulated value is returned.
  * @param string $columnName The name of the database column whose value should be read
  * @param string $format     For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011'. @n
  *                           For text columns the format can be @b database that would return the original database value without any transformations
  * @return int|string Returns the value of the database column.
  *                    If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     if ($columnName === 'txt_text') {
         return $this->dbColumns['txt_text'];
     } else {
         return parent::getValue($columnName, $format);
     }
 }
Beispiel #2
0
 /** Get the value of a column of the database table.
  *  If the value was manipulated before with @b setValue than the manipulated value is returned.
  *  @param $columnName The name of the database column whose value should be read
  *  @param $format For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011'. @n
  *                 For text columns the format can be @b database that would return the original database value without any transformations
  *  @return Returns the value of the database column.
  *          If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     if ($columnName == 'ann_description') {
         if (isset($this->dbColumns['ann_description']) == false) {
             $value = '';
         } elseif ($format == 'database') {
             $value = html_entity_decode(strStripTags($this->dbColumns['ann_description']), ENT_QUOTES, 'UTF-8');
         } else {
             $value = $this->dbColumns['ann_description'];
         }
     } else {
         $value = parent::getValue($columnName, $format);
     }
     return $value;
 }
 /**
  * Get the value of a column of the database table.
  * If the value was manipulated before with @b setValue than the manipulated value is returned.
  * @param string $columnName The name of the database column whose value should be read
  * @param string $format     For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011'. @n
  *                           For text columns the format can be @b database that would return the original database value without any transformations
  * @return Returns the value of the database column.
  *         If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     if ($columnName === 'gbc_text') {
         if (!isset($this->dbColumns['gbc_text'])) {
             $value = '';
         } elseif ($format === 'database') {
             $value = html_entity_decode(strStripTags($this->dbColumns['gbc_text']));
         } else {
             $value = $this->dbColumns['gbc_text'];
         }
     } else {
         $value = parent::getValue($columnName, $format);
     }
     return $value;
 }
Beispiel #4
0
 /**
  * Get the value of a column of the database table.
  * If the value was manipulated before with @b setValue than the manipulated value is returned.
  * @param  string $columnName The name of the database column whose value should be read
  * @param  string $format     For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011'. @n
  *                            For text columns the format can be @b database that would return the original database value without any transformations
  * @return mixed  Returns the value of the database column.
  *                If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     global $gL10n;
     if ($columnName === 'lnk_description') {
         if (isset($this->dbColumns['lnk_description']) === false) {
             $value = '';
         } elseif ($format === 'database') {
             $value = html_entity_decode(strStripTags($this->dbColumns['lnk_description']));
         } else {
             $value = $this->dbColumns['lnk_description'];
         }
     } else {
         $value = parent::getValue($columnName, $format);
     }
     if ($columnName === 'cat_name' && $format !== 'database') {
         // if text is a translation-id then translate it
         if (strpos($value, '_') === 3) {
             $value = $gL10n->get(admStrToUpper($value));
         }
     }
     return $value;
 }
 /**
  * Get the value of a column of the database table.
  * If the value was manipulated before with @b setValue than the manipulated value is returned.
  * @param string $columnName The name of the database column whose value should be read
  * @param string $format     For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011'. @n
  *                           For text columns the format can be @b database that would return the original database value without any transformations
  * @return int|string|bool Returns the value of the database column.
  *                         If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     global $gL10n;
     if ($columnName === 'cat_name_intern') {
         // internal name should be read with no conversion
         $value = parent::getValue($columnName, 'database');
     } else {
         $value = parent::getValue($columnName, $format);
     }
     if ($columnName === 'cat_name' && $format !== 'database') {
         // if text is a translation-id then translate it
         if (strpos($value, '_') === 3) {
             $value = $gL10n->get(admStrToUpper($value));
         }
     }
     return $value;
 }
Beispiel #6
0
 /**
  * Get the value of a column of the database table.
  * If the value was manipulated before with @b setValue than the manipulated value is returned.
  * @param string $columnName The name of the database column whose value should be read
  * @param string $format     For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011'. @n
  *                           For text columns the format can be @b database that would return the original database value without any transformations
  * @return int|float|string|bool Returns the value of the database column.
  *                               If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     global $gL10n;
     $value = parent::getValue($columnName, $format);
     if ($columnName === 'cat_name' && $format !== 'database') {
         // if text is a translation-id then translate it
         if (strpos($value, '_') === 3) {
             $value = $gL10n->get(admStrToUpper($value));
         }
     }
     return $value;
 }
 /**
  * Get the value of a column of the database table.
  * If the value was manipulated before with @b setValue than the manipulated value is returned.
  * @param string $columnName The name of the database column whose value should be read
  * @param string $format     For column @c usf_value_list the following format is accepted: @n
  *                           @b database returns database value of usf_value_list; @n
  *                           @b text extract only text from usf_value_list, image infos will be ignored @n
  *                           For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011' @n
  *                           For text columns the format can be @b database that would be the database value without any transformations
  * @return Returns the value of the database column.
  *         If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     global $gL10n;
     if ($columnName === 'inf_description') {
         if (!isset($this->dbColumns['inf_description'])) {
             $value = '';
         } elseif ($format === 'database') {
             $value = html_entity_decode(strStripTags($this->dbColumns['inf_description']), ENT_QUOTES, 'UTF-8');
         } else {
             $value = $this->dbColumns['inf_description'];
         }
     } elseif ($columnName === 'inf_name_intern') {
         // internal name should be read with no conversion
         $value = parent::getValue($columnName, 'database');
     } else {
         $value = parent::getValue($columnName, $format);
     }
     if (($columnName === 'inf_name' || $columnName === 'cat_name') && $format !== 'database') {
         // if text is a translation-id then translate it
         if (strpos($value, '_') === 3) {
             $value = $gL10n->get(admStrToUpper($value));
         }
     } elseif ($columnName === 'inf_value_list' && $format !== 'database') {
         if ($this->dbColumns['inf_type'] === 'DROPDOWN' || $this->dbColumns['inf_type'] === 'RADIO_BUTTON') {
             $arrListValues = explode("\r\n", $value);
             $arrListValuesWithKeys = array();
             // array with list values and keys that represents the internal value
             foreach ($arrListValues as $key => &$listValue) {
                 if ($this->dbColumns['inf_type'] === 'RADIO_BUTTON') {
                     // if value is imagefile or imageurl then show image
                     if (strpos(admStrToLower($listValue), '.png') > 0 || strpos(admStrToLower($listValue), '.jpg') > 0) {
                         // if there is imagefile and text separated by | then explode them
                         if (strpos($listValue, '|') > 0) {
                             $listValueImage = substr($listValue, 0, strpos($listValue, '|'));
                             $listValueText = substr($listValue, strpos($listValue, '|') + 1);
                         } else {
                             $listValueImage = $listValue;
                             $listValueText = $this->getValue('inf_name');
                         }
                         // if text is a translation-id then translate it
                         if (strpos($listValueText, '_') === 3) {
                             $listValueText = $gL10n->get(admStrToUpper($listValueText));
                         }
                         if ($format === 'text') {
                             // if no image is wanted then return the text part or only the position of the entry
                             if (strpos($listValue, '|') > 0) {
                                 $listValue = $listValueText;
                             } else {
                                 $listValue = $key + 1;
                             }
                         } else {
                             try {
                                 // create html for optionbox entry
                                 if (strpos(admStrToLower($listValueImage), 'http') === 0 && strValidCharacters($listValueImage, 'url')) {
                                     $listValue = '<img class="admidio-icon-info" src="' . $listValueImage . '" title="' . $listValueText . '" alt="' . $listValueText . '" />';
                                 } elseif (admStrIsValidFileName($listValueImage, true)) {
                                     $listValue = '<img class="admidio-icon-info" src="' . THEME_PATH . '/icons/' . $listValueImage . '" title="' . $listValueText . '" alt="' . $listValueText . '" />';
                                 }
                             } catch (AdmException $e) {
                                 $e->showText();
                             }
                         }
                     }
                 }
                 // if text is a translation-id then translate it
                 if (strpos($listValue, '_') === 3) {
                     $listValue = $gL10n->get(admStrToUpper($listValue));
                 }
                 // save values in new array that starts with key = 1
                 $arrListValuesWithKeys[++$key] = $listValue;
             }
             $value = $arrListValuesWithKeys;
         }
     }
     return $value;
 }
Beispiel #8
0
 /**
  * If the value was manipulated before with @b setValue than the manipulated value is returned.
  * @param string $columnName The name of the database column whose value should be read
  * @param string $format     For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011'. @n
  *                           For text columns the format can be @b database that would return the original database value without any transformations
  * @return int|string|bool Returns the value of the database column.
  *                         If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     global $gL10n;
     $value = parent::getValue($columnName, $format);
     // getValue transforms & to html chars. This must be undone.
     if ($columnName === 'fil_name') {
         $value = htmlspecialchars_decode($value);
     }
     return $value;
 }
Beispiel #9
0
 /**
  * Get the value of a column of the database table.
  * If the value was manipulated before with @b setValue than the manipulated value is returned.
  * @param  string $columnName The name of the database column whose value should be read
  * @param  string $format     For date or timestamp columns the format should be
  *                            the date/time format e.g. @b d.m.Y = '02.04.2011'. @n
  *                            For text columns the format can be @b database that would return
  *                            the original database value without any transformations
  * @return mixed  Returns the value of the database column.
  *                           If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     global $gL10n;
     if ($columnName === 'dat_end' && $this->dbColumns['dat_all_day'] == 1) {
         if ($format === '') {
             $format = 'Y-m-d';
         }
         // bei ganztaegigen Terminen wird das Enddatum immer 1 Tag zurueckgesetzt
         list($year, $month, $day, $hour, $minute, $second) = preg_split('/[- :]/', $this->dbColumns['dat_end']);
         $value = date($format, mktime($hour, $minute, $second, $month, $day, $year) - 86400);
     } elseif ($columnName === 'dat_description') {
         if (!isset($this->dbColumns['dat_description'])) {
             $value = '';
         } elseif ($format === 'database') {
             $value = html_entity_decode(strStripTags($this->dbColumns['dat_description']), ENT_QUOTES, 'UTF-8');
         } else {
             $value = $this->dbColumns['dat_description'];
         }
     } else {
         $value = parent::getValue($columnName, $format);
     }
     if ($format !== 'database') {
         if ($columnName === 'dat_country' && $value !== '') {
             // beim Land die sprachabhaengige Bezeichnung auslesen
             $value = $gL10n->getCountryByCode($value);
         } elseif ($columnName === 'cat_name') {
             // if text is a translation-id then translate it
             if (strpos($value, '_') === 3) {
                 $value = $gL10n->get(admStrToUpper($value));
             }
         }
     }
     return $value;
 }
Beispiel #10
0
 /** Get the value of a column of the database table.
  *  If the value was manipulated before with @b setValue than the manipulated value is returned.
  *  @param $columnName The name of the database column whose value should be read
  *  @param $format For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011'. @n
  *                 For text columns the format can be @b database that would return the original database value without any transformations
  *  @return Returns the value of the database column.
  *          If the value was manipulated before with @b setValue than the manipulated value is returned.
  */
 public function getValue($columnName, $format = '')
 {
     $value = parent::getValue($columnName, $format);
     if ($columnName == 'fol_name') {
         // Konvertiert HTML-Auszeichnungen zurück in Buchstaben
         $value = html_entity_decode($value, ENT_QUOTES, 'UTF-8');
     }
     return $value;
 }