Exemple #1
0
 /**
  * Add prefix path for plugin loader for captcha adapters
  *
  * This method handles the captcha type, the rest is handled by
  * the parent
  * @param  string $prefix
  * @param  string $path
  * @param  string $type
  * @return Zend_Form_Element
  * @see Zend_Form_Element::addPrefixPath
  */
 public function addPrefixPath($prefix, $path, $type = null)
 {
     $type = strtoupper($type);
     switch ($type) {
         case null:
             $loader = $this->getPluginLoader(self::CAPTCHA);
             $nsSeparator = false !== strpos($prefix, '\\') ? '\\' : '_';
             $cPrefix = rtrim($prefix, $nsSeparator) . $nsSeparator . 'Captcha';
             $cPath = rtrim($path, '/\\') . '/Captcha';
             $loader->addPrefixPath($cPrefix, $cPath);
             return parent::addPrefixPath($prefix, $path);
         case self::CAPTCHA:
             $loader = $this->getPluginLoader($type);
             $loader->addPrefixPath($prefix, $path);
             return $this;
         default:
             return parent::addPrefixPath($prefix, $path, $type);
     }
 }
 /**
  * Add prefix path for plugin loader
  *
  * @param  string $prefix
  * @param  string $path
  * @param  string $type
  * @return Zend_Form_Element_File
  */
 public function addPrefixPath($prefix, $path, $type = null)
 {
     $type = strtoupper($type);
     if (!empty($type) && $type != self::TRANSFER_ADAPTER) {
         return parent::addPrefixPath($prefix, $path, $type);
     }
     if (empty($type)) {
         $pluginPrefix = rtrim($prefix, '_') . '_Transfer_Adapter';
         $pluginPath = rtrim($path, DIRECTORY_SEPARATOR) . '/Transfer/Adapter/';
         $loader = $this->getPluginLoader(self::TRANSFER_ADAPTER);
         $loader->addPrefixPath($pluginPrefix, $pluginPath);
         return parent::addPrefixPath($prefix, $path, null);
     }
     $loader = $this->getPluginLoader($type);
     $loader->addPrefixPath($prefix, $path);
     return $this;
 }