Dotclear

Changeset 852:969647a6c35e for inc/core


Ignore:
Timestamp:
07/31/12 15:15:32 (13 years ago)
Author:
Dsls <dsls@…>
Branch:
sexy
Message:

sexy step 3 : no more media.

Location:
inc/core
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.auth.php

    r851 r852  
    7575               'publish' => __('publish entries and comments'), 
    7676               'delete' => __('delete entries and comments'), 
    77                'contentadmin' => __('manage all entries and comments'), 
    78                'media' => __('manage their own media items'), 
    79                'media_admin' => __('manage all media items') 
     77               'contentadmin' => __('manage all entries and comments') 
    8078          ); 
    8179     } 
  • inc/core/class.dc.blog.php

    r851 r852  
    361361          $rs = $this->con->select($strReq); 
    362362          $rs->core = $this->core; 
    363           $rs->_nb_media = array(); 
    364363          $rs->extend('rsExtPost'); 
    365364           
  • inc/core/class.dc.core.php

    r848 r852  
    3535     public $wiki2xhtml; ///< <b>wiki2xhtml</b>        wiki2xhtml object 
    3636     public $plugins;    ///< <b>dcModules</b>         dcModules object 
    37      public $media;      ///< <b>dcMedia</b>           dcMedia object 
    38      public $postmedia;  ///< <b>dcPostMedia</b>       dcPostMedia object 
    3937     public $rest;       ///< <b>dcRestServer</b> dcRestServer object 
    4038     public $log;        ///< <b>dcLog</b>             dcLog object 
     
    12021200                    array('lang','string','en', 
    12031201                    'Default blog language'), 
    1204                     array('media_exclusion','string','/\.php$/i', 
    1205                     'File name exclusion pattern in media manager. (PCRE value)'), 
    1206                     array('media_img_m_size','integer',448, 
    1207                     'Image medium size in media manager'), 
    1208                     array('media_img_s_size','integer',240, 
    1209                     'Image small size in media manager'), 
    1210                     array('media_img_t_size','integer',100, 
    1211                     'Image thumbnail size in media manager'), 
    1212                     array('media_img_title_pattern','string','Title ;; Date(%b %Y) ;; separator(, )', 
    1213                     'Pattern to set image title when you insert it in a post'), 
    12141202                    array('nb_post_per_page','integer',20, 
    12151203                    'Number of entries on home page and category pages'), 
  • inc/core/class.dc.rs.extensions.php

    r851 r852  
    335335     } 
    336336      
    337      /** 
    338      Returns post media count using a subquery. 
    339       
    340      @param    rs   Invisible parameter 
    341      @return   <b>integer</b> 
    342      */ 
    343      public static function countMedia($rs) 
    344      { 
    345           if (isset($rs->_nb_media[$rs->index()])) 
    346           { 
    347                return $rs->_nb_media[$rs->index()]; 
    348           } 
    349           else 
    350           { 
    351                $strReq = 
    352                'SELECT count(media_id) '. 
    353                'FROM '.$rs->core->prefix.'post_media '. 
    354                'WHERE post_id = '.(integer) $rs->post_id.' '; 
    355                 
    356                $res = (integer) $rs->core->con->select($strReq)->f(0); 
    357                $rs->_nb_media[$rs->index()] = $res; 
    358                return $res; 
    359           } 
    360      } 
    361337} 
    362338 
  • inc/core/class.dc.xmlrpc.php

    r851 r852  
    7575               'List of most recent posts in the system'); 
    7676           
    77           $this->addCallback('metaWeblog.newMediaObject',array($this,'mw_newMediaObject'), 
    78                array('struct','string','string','string','struct'), 
    79                'Upload a file on the web server'); 
    80            
    8177          # MovableType methods 
    8278          $this->addCallback('mt.getRecentPostTitles',array($this,'mt_getRecentPostTitles'), 
     
    573569           
    574570          return true; 
    575      } 
    576       
    577      private function newMediaObject($blog_id,$user,$pwd,$file) 
    578      { 
    579           if (empty($file['name'])) { 
    580                throw new Exception('No file name'); 
    581           } 
    582            
    583           if (empty($file['bits'])) { 
    584                throw new Exception('No file content'); 
    585           } 
    586            
    587           $file_name = $file['name']; 
    588           $file_bits = $file['bits']; 
    589            
    590           $this->setUser($user,$pwd); 
    591           $this->setBlog(); 
    592            
    593           $media = new dcMedia($this->core); 
    594            
    595           $dir_name = path::clean(dirname($file_name)); 
    596           $file_name = basename($file_name); 
    597            
    598           $dir_name = preg_replace('!^/!','',$dir_name); 
    599           if ($dir_name != '') 
    600           { 
    601                $dir = explode('/',$dir_name); 
    602                $cwd = './'; 
    603                foreach ($dir as $v) 
    604                { 
    605                     $v = files::tidyFileName($v); 
    606                     $cwd .= $v.'/'; 
    607                     $media->makeDir($v); 
    608                     $media->chdir($cwd); 
    609                } 
    610           } 
    611            
    612           $media_id = $media->uploadBits($file_name,$file_bits); 
    613            
    614           $f = $media->getFile($media_id); 
    615           return array( 
    616                'file' => $file_name, 
    617                'url' => $f->file_url, 
    618                'type' => files::getMimeType($file_name) 
    619           ); 
    620571     } 
    621572      
     
    940891     } 
    941892      
    942      public function mw_newMediaObject($blogid,$username,$password,$file) 
    943      { 
    944           return $this->newMediaObject($blogid,$username,$password,$file); 
    945      } 
    946       
    947893     /* MovableType methods 
    948894     --------------------------------------------------- */ 
     
    1024970     { 
    1025971          return $this->getTags($username,$password); 
    1026      } 
    1027       
    1028      public function wp_uploadFile($blogid,$username,$password,$file) 
    1029      { 
    1030           return $this->newMediaObject($blogid,$username,$password,$file); 
    1031972     } 
    1032973      
Note: See TracChangeset for help on using the changeset viewer.

Sites map