protected $custom = true;
/**
- * Default constructor.
- */
+ * Default constructor.
+ */
public function __construct()
{
parent::__construct($this->id);
}
/**
- * Gets the default picture to show, anyways
- *
- * @see Picture::getDefaultPicture()
- *
- * @return void
- */
+ * Gets the default picture to show, anyways
+ *
+ * @see Picture::getDefaultPicture()
+ *
+ * @return void
+ */
protected function getDefaultPicture()
{
$this->file_path = _CURRENT_TEMPLATE_PATH . 'images/galette.png';
}
/**
- * Returns the relevant query to check if picture exists in database.
- *
- * @see picture::getCheckFileQuery()
- *
- * @return string SELECT query
- */
+ * Returns the relevant query to check if picture exists in database.
+ *
+ * @see picture::getCheckFileQuery()
+ *
+ * @return string SELECT query
+ */
protected function getCheckFileQuery()
{
global $zdb;
}
/**
- * Returns custom state
- *
- * @return boolean
- */
+ * Returns custom state
+ *
+ * @return boolean
+ */
public function isCustom()
{
return $this->custom;
$ret = array();
foreach ( $results as $r ) {
if ( $r['mailing_sender'] !== null ) {
- $r['mailing_sender_name'] = Adherent::getSName($r['mailing_sender']);
+ $r['mailing_sender_name']
+ = Adherent::getSName($r['mailing_sender']);
}
$body_resume = $r['mailing_body'];
if ( strlen($body_resume) > 150 ) {
}
return $ret;
} catch (\Exception $e) {
- /** TODO */
Analog::log(
'Unable to get history. | ' . $e->getMessage(),
Analog::WARNING
);
- Analog::log(
- 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
- Analog::ERROR
- );
return false;
}
}
} else {
//not numeric and not an array: incorrect.
Analog::log(
- 'Asking to remove mailing entries, but without providing an array or a single numeric value.',
+ 'Asking to remove mailing entries, but without ' .
+ 'providing an array or a single numeric value.',
Analog::WARNING
);
return false;
);
/**
- * Default constructor
- */
+ * Default constructor
+ */
public function __construct()
{
$this->reinit();
}
/**
- * Returns the field we want to default set order to
- *
- * @return string field name
- */
+ * Returns the field we want to default set order to
+ *
+ * @return string field name
+ */
abstract protected function getDefaultOrder();
/**
}
/**
- * Reinit default parameters
- *
- * @return void
- */
+ * Reinit default parameters
+ *
+ * @return void
+ */
public function reinit()
{
global $preferences;
}
/**
- * Invert sort order
- *
- * @return void
- */
+ * Invert sort order
+ *
+ * @return void
+ */
public function invertorder()
{
$actual=$this->_ordered;
}
/**
- * Get current sort direction
- *
- * @return self::ORDER_ASC|self::ORDER_DESC
- */
+ * Get current sort direction
+ *
+ * @return self::ORDER_ASC|self::ORDER_DESC
+ */
public function getDirection()
{
return $this->_ordered;
}
/**
- * Set sort direction
- *
- * @param string $direction self::ORDER_ASC|self::ORDER_DESC
- *
- * @return void
- */
+ * Set sort direction
+ *
+ * @param string $direction self::ORDER_ASC|self::ORDER_DESC
+ *
+ * @return void
+ */
public function setDirection($direction)
{
if ( $direction == self::ORDER_ASC || $direction == self::ORDER_DESC ) {
/**
* Add limits so we retrieve only relavant rows
*
- * @param Zend_Db_Statement $select Original select
+ * @param Select $select Original select
*
* @return void
*/
}
/**
- * Update or set pages count
- *
- * @return void
- */
+ * Update or set pages count
+ *
+ * @return void
+ */
protected function countPages()
{
if ( $this->_show !== 0 ) {
}
/**
- * Creates pagination links and assign some usefull variables to the
- * Smarty template
- *
- * @param Smarty $tpl Smarty template
- * @param boolean $restricted Do not permit to display all
- *
- * @return void
- */
+ * Creates pagination links and assign some usefull variables to the
+ * Smarty template
+ *
+ * @param Smarty $tpl Smarty template
+ * @param boolean $restricted Do not permit to display all
+ *
+ * @return void
+ */
public function setSmartyPagination($tpl, $restricted = true)
{
$paginate = null;
}
/**
- * Global getter method
- *
- * @param string $name name of the property we want to retrive
- *
- * @return object the called property
- */
+ * Global getter method
+ *
+ * @param string $name name of the property we want to retrive
+ *
+ * @return object the called property
+ */
public function __get($name)
{
}
/**
- * Global setter method
- *
- * @param string $name name of the property we want to assign a value to
- * @param object $value a relevant value for the property
- *
- * @return void
- */
+ * Global setter method
+ *
+ * @param string $name name of the property we want to assign a value to
+ * @param object $value a relevant value for the property
+ *
+ * @return void
+ */
public function __set($name, $value)
{
protected $max_height = 200;
/**
- * Default constructor.
- *
- * @param int $id_adh the id of the member
- */
+ * Default constructor.
+ *
+ * @param int $id_adh the id of the member
+ */
public function __construct( $id_adh='' )
{
// '!==' needed, otherwise ''==0
}
/**
- * "Magic" function called on unserialize
- *
- * @return void
- */
+ * "Magic" function called on unserialize
+ *
+ * @return void
+ */
public function __wakeup()
{
//if file has been deleted since we store our object in the session,
}
/**
- * Check if current file is present on the File System
- *
- * @return boolean true if file is present on FS, false otherwise
- */
+ * Check if current file is present on the File System
+ *
+ * @return boolean true if file is present on FS, false otherwise
+ */
private function _checkFileOnFS()
{
$file_wo_ext = $this->store_path . $this->id;
}
/**
- * Check if current file is present in the database,
- * and copy it to the File System
- *
- * @return boolean true if file is present in the DB, false otherwise
- */
+ * Check if current file is present in the database,
+ * and copy it to the File System
+ *
+ * @return boolean true if file is present in the DB, false otherwise
+ */
private function _checkFileInDB()
{
global $zdb;
}
/**
- * Returns the relevant query to check if picture exists in database.
- *
- * @return string SELECT query
- */
+ * Returns the relevant query to check if picture exists in database.
+ *
+ * @return string SELECT query
+ */
protected function getCheckFileQuery()
{
global $zdb;
}
/**
- * Gets the default picture to show, anyways
- *
- * @return void
- */
+ * Gets the default picture to show, anyways
+ *
+ * @return void
+ */
protected function getDefaultPicture()
{
$this->file_path = _CURRENT_TEMPLATE_PATH . 'images/default.png';
}
/**
- * Set picture sizes
- *
- * @return void
- */
+ * Set picture sizes
+ *
+ * @return void
+ */
private function _setSizes()
{
list($width, $height) = getimagesize($this->file_path);
}
/**
- * Set header and displays the picture.
- *
- * @return object the binary file
- */
+ * Set header and displays the picture.
+ *
+ * @return object the binary file
+ */
public function display()
{
header('Content-type: '.$this->mime);
}
/**
- * Stores an image on the disk and in the database
- *
- * @param object $file the uploaded file
- * @param boolean $ajax If the image cames from an ajax call (dnd)
- *
- * @return true|false result of the storage process
- */
+ * Stores an image on the disk and in the database
+ *
+ * @param object $file the uploaded file
+ * @param boolean $ajax If the image cames from an ajax call (dnd)
+ *
+ * @return true|false result of the storage process
+ */
public function store($file, $ajax = false)
{
/** TODO:
}
/**
- * Resize the image if it exceed max allowed sizes
- *
- * @param string $source the source image
- * @param string $ext file's extension
- * @param string $dest the destination image.
- * If null, we'll use the source image. Defaults to null
- *
- * @return void
- */
+ * Resize the image if it exceed max allowed sizes
+ *
+ * @param string $source the source image
+ * @param string $ext file's extension
+ * @param string $dest the destination image.
+ * If null, we'll use the source image. Defaults to null
+ *
+ * @return void
+ */
private function _resizeImage($source, $ext, $dest = null)
{
$class = get_class($this);