[ Index ]
 

Code source de DokuWiki 2006-11-06

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/plugins/config/settings/ -> extra.class.php (source)

   1  <?php
   2  /**
   3   * additional setting classes specific to these settings
   4   *
   5   * @author    Chris Smith <chris@jalakai.co.uk>
   6   */
   7  
   8  if (!class_exists('setting_sepchar')) {
   9    class setting_sepchar extends setting_multichoice {
  10  
  11      function setting_sepchar($key,$param=NULL) {
  12          $str = '_-.';
  13          for ($i=0;$i<strlen($str);$i++) $this->_choices[] = $str{$i};
  14  
  15          // call foundation class constructor
  16          $this->setting($key,$param);
  17      }
  18    }
  19  }
  20  
  21  if (!class_exists('setting_savedir')) {
  22    class setting_savedir extends setting_string {
  23  
  24      function update($input) {
  25          if ($this->is_protected()) return false;
  26  
  27          $value = is_null($this->_local) ? $this->_default : $this->_local;
  28          if ($value == $input) return false;
  29  
  30          if (!init_path($input)) {
  31            $this->_error = true;
  32            $this->_input = $input;
  33            return false;
  34          }
  35  
  36          $this->_local = $input;
  37          return true;
  38      }
  39    }
  40  }
  41  
  42  if (!class_exists('setting_authtype')) {
  43    class setting_authtype extends setting_multichoice {
  44  
  45      function initialize($default,$local,$protected) {
  46  
  47        // populate $this->_choices with a list of available auth mechanisms
  48        $authtypes = glob(DOKU_INC.'inc/auth/*.class.php');
  49        $authtypes = preg_replace('#^.*/([^/]*)\.class\.php$#i','$1', $authtypes);
  50        sort($authtypes);
  51  
  52        $this->_choices = $authtypes;
  53  
  54        parent::initialize($default,$local,$protected);
  55      }
  56    }
  57  }
  58  
  59  if (!class_exists('setting_im_convert')) {
  60    class setting_im_convert extends setting_string {
  61  
  62      function update($input) {
  63          if ($this->is_protected()) return false;
  64  
  65          $input = trim($input);
  66  
  67          $value = is_null($this->_local) ? $this->_default : $this->_local;
  68          if ($value == $input) return false;
  69  
  70          if ($input && !@file_exists($input)) {
  71            $this->_error = true;
  72            $this->_input = $input;
  73            return false;
  74          }
  75  
  76          $this->_local = $input;
  77          return true;
  78      }
  79    }
  80  }
  81  
  82  if (!class_exists('setting_disableactions')) {
  83    class setting_disableactions extends setting_multicheckbox {
  84  
  85      function html(&$plugin, $echo=false) {
  86          global $lang;
  87  
  88          // make some language adjustments (there must be a better way)
  89          // transfer some DokuWiki language strings to the plugin
  90          if (!$plugin->localised) $this->setupLocale();
  91          $plugin->lang[$this->_key.'_revisions'] = $lang['btn_revs'];
  92          $plugin->lang[$this->_key.'_register'] = $lang['register'];
  93  
  94          foreach ($this->_choices as $choice)
  95            if (isset($lang['btn_'.$choice])) $plugin->lang[$this->_key.'_'.$choice] = $lang['btn_'.$choice];
  96  
  97          return parent::html($plugin, $echo);
  98      }
  99    }
 100  }


Généré le : Tue Apr 3 20:47:31 2007 par Balluche grâce à PHPXref 0.7