Example #1
0
 public static function createEmptyImage($w, $h, $mime = '', $transparent = true)
 {
     $image = new self('', $mime);
     if (!empty($mime)) {
         $image->setMIMEType($mime);
     }
     if (in_array($mime, array('image/png', 'image/gif')) && $transparent) {
         $image->getAdapter()->setHolder($image->getAdapter()->getTransparentImage($w, $h));
     } else {
         $image->getAdapter()->create($w, $h);
     }
     return $image;
 }
Example #2
0
 public static function hasUsers()
 {
     $user = new self();
     $def = $user->getDefinition();
     $results = $user->getAdapter()->query("SELECT count(*) users FROM {$def['table']}")->execute();
     foreach ($results as $row) {
         return $row['users'] > 0;
     }
 }
Example #3
0
 public static function addPage($Title, $IDParent, $Url, $IDType, $Text)
 {
     $Page = new self();
     $Position = $Page->getAdapter()->fetchRow($Page->getAdapter()->select()->from('page', array('Position' => new Zend_Db_Expr('IFNULL(MAX(Position), 0) + 1')))->where("IDParent = '{$IDParent}'"));
     $Position = $Position['Position'];
     $Data = array('Title' => $Title, 'IDParent' => $IDParent, 'Url' => $Url, 'IDType' => $IDType, 'Text' => $Text, 'Position' => $Position);
     return $Page->insert($Data);
 }