コード例 #1
0
ファイル: class.vf_uploader.php プロジェクト: hshoghi/cms
    /**
     *	sets object params by the args array
     *	@param	array	$args
     *	@global $disable_vf
     */
    public function __construct(array $args = array())
    {
        global $disable_vf;
        if ($disable_vf) {
            ?>
			<strong style="color:red;">
				The Uploader Is Temporarily Disabled Due to Technical Difficulties.
			</strong>
<?php 
            return;
        }
        $this->setByArray(self::$defaults)->setByArray($args);
        if ($this->gallery && !$this->folder) {
            $this->folder = $this->gallery->folder;
        }
        $this->setMemToken();
        if (!$this->folder) {
            throw new Exception('class: vf_uploader requires a folder paramter');
        } else {
            if (!is_object($this->folder)) {
                $this->folder = vf::getFolder($this->folder);
            }
        }
        if (!$this->folder->folders_path) {
            throw new Exception('Could not get folder object from server.');
        }
        $this->makeButton();
    }
コード例 #2
0
ファイル: class.vf_gallery_inc.php プロジェクト: hshoghi/cms
 public function initFolder($refresh = false)
 {
     $path = is_object($this->folder) ? $this->folder->folders_path : $this->folder;
     $e = $refresh || is_ajax_request() ? array('refresh_memcached' => true) : null;
     return $this->folder = vf::getFolder($path, array('limit' => $this->limit), $e);
 }