]> git.agnieray.net Git - galette.git/commitdiff
Align comments, cleanup
authorJohan Cwiklinski <johan@x-tnd.be>
Tue, 19 Nov 2013 21:45:26 +0000 (22:45 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 22 Dec 2013 09:14:24 +0000 (10:14 +0100)
galette/lib/Galette/Core/Logo.php
galette/lib/Galette/Core/MailingHistory.php
galette/lib/Galette/Core/Pagination.php
galette/lib/Galette/Core/Picture.php

index ebe0ab26c12dd9361208a83891c0bc19ec3bc57a..f97cb6e725259d1ec8f20b16cb6db02e4e73cffc 100644 (file)
@@ -61,20 +61,20 @@ class Logo extends Picture
     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';
@@ -84,12 +84,12 @@ class Logo extends Picture
     }
 
     /**
-    * 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;
@@ -106,10 +106,10 @@ class Logo extends Picture
     }
 
     /**
-    * Returns custom state
-    *
-    * @return boolean
-    */
+     * Returns custom state
+     *
+     * @return boolean
+     */
     public function isCustom()
     {
         return $this->custom;
index 119343b4342c2042ac6a2b6313ede9604d9683f4..8851056bedbbf5c7f45bbf41e993c61ab9051c03 100644 (file)
@@ -134,7 +134,8 @@ class MailingHistory extends History
             $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 ) {
@@ -177,15 +178,10 @@ class MailingHistory extends History
             }
             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;
         }
     }
@@ -389,7 +385,8 @@ class MailingHistory extends History
         } 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;
index 21d41dfa00cc27b994ab722af5b2c28570c3ab02..ead1b6e43cd12929aad10adfc963dc776cd53b74 100644 (file)
@@ -74,18 +74,18 @@ abstract class Pagination
     );
 
     /**
-    * 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();
 
     /**
@@ -99,10 +99,10 @@ abstract class Pagination
     }
 
     /**
-    * Reinit default parameters
-    *
-    * @return void
-    */
+     * Reinit default parameters
+     *
+     * @return void
+     */
     public function reinit()
     {
         global $preferences;
@@ -114,10 +114,10 @@ abstract class Pagination
     }
 
     /**
-    * Invert sort order
-    *
-    * @return void
-    */
+     * Invert sort order
+     *
+     * @return void
+     */
     public function invertorder()
     {
         $actual=$this->_ordered;
@@ -130,22 +130,22 @@ abstract class Pagination
     }
 
     /**
-    * 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 ) {
@@ -163,7 +163,7 @@ abstract class Pagination
     /**
      * Add limits so we retrieve only relavant rows
      *
-     * @param Zend_Db_Statement $select Original select
+     * @param Select $select Original select
      *
      * @return void
      */
@@ -176,10 +176,10 @@ abstract class Pagination
     }
 
     /**
-    * Update or set pages count
-    *
-    * @return void
-    */
+     * Update or set pages count
+     *
+     * @return void
+     */
     protected function countPages()
     {
         if ( $this->_show !== 0 ) {
@@ -200,14 +200,14 @@ abstract class Pagination
     }
 
     /**
-    * 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;
@@ -278,12 +278,12 @@ abstract class Pagination
     }
 
     /**
-    * 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)
     {
 
@@ -306,13 +306,13 @@ abstract class Pagination
     }
 
     /**
-    * 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)
     {
 
index df749ddf8557c32bad138ce75f6fbbe758969b91..b4ce0852aca534fa94963ea28490ffc53fa48cb7 100644 (file)
@@ -111,10 +111,10 @@ class Picture
     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
@@ -142,10 +142,10 @@ class Picture
     }
 
     /**
-    * "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,
@@ -168,10 +168,10 @@ class Picture
     }
 
     /**
-    * 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;
@@ -195,11 +195,11 @@ class Picture
     }
 
     /**
-    * 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;
@@ -238,10 +238,10 @@ class Picture
     }
 
     /**
-    * 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;
@@ -259,10 +259,10 @@ class Picture
     }
 
     /**
-    * 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';
@@ -272,10 +272,10 @@ class Picture
     }
 
     /**
-    * Set picture sizes
-    *
-    * @return void
-    */
+     * Set picture sizes
+     *
+     * @return void
+     */
     private function _setSizes()
     {
         list($width, $height) = getimagesize($this->file_path);
@@ -300,10 +300,10 @@ class Picture
     }
 
     /**
-    * 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);
@@ -397,13 +397,13 @@ class Picture
     }
 
     /**
-    * 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:
@@ -535,15 +535,15 @@ class Picture
     }
 
     /**
-    * 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);