Пример #1
0
 /**
  * Ask each sanitizer extension for default configuration
  *
  * @return array
  */
 public function buildDefaultConfiguration()
 {
     $this->registerComponent(\Xoops\Core\Text\Sanitizer::getDefaultConfig());
     $extensions = File::getList(__DIR__ . '/Extensions');
     foreach ($extensions as $extensionFile) {
         if (substr($extensionFile, -4) === '.php') {
             $class = __NAMESPACE__ . '\\Extensions\\' . substr($extensionFile, 0, -4);
             if (is_a($class, 'Xoops\\Core\\Text\\Sanitizer\\SanitizerConfigurable', true)) {
                 $this->registerComponent($class::getDefaultConfig());
             }
         }
     }
     /**
      * Register any 3rd party extensions
      *
      * Listeners will be passed a Configuration object as the single argument, and should
      * call $arg->registerComponent() to register extensions
      *
      * All extensions must implement SanitizerConfigurable, extending either ExtensionAbstract
      * or FilterAbstract, and MUST autoload
      *
      * NB: Extensions and Filters all share the same configuration space, so a 3rd party
      * extension that has the same short name as system extension will override the system
      * supplied one.
      */
     \Xoops::getInstance()->events()->triggerEvent('core.sanitizer.configuration.defaults', $this);
     return (array) $this;
 }
Пример #2
0
 /**
  * expects an array of array containing:
  * name,      Name of the submenu
  * url,       Url of the submenu relative to the module
  * ex: return array(0 => array(
  *      'name' => _MI_PUBLISHER_SUB_SMNAME3;
  *      'url' => "search.php";
  *    ));
  *
  * @return array
  */
 public function subMenus()
 {
     $xoops = Xoops::getInstance();
     $ret = array();
     $files = \Xoops\Core\Lists\File::getList($xoops->path('modules/codex/'));
     $i = 0;
     foreach ($files as $file) {
         if (!in_array($file, array('xoops_version.php', 'index.php'))) {
             $fileName = ucfirst(str_replace('.php', '', $file));
             $ret[$i]['name'] = $fileName;
             $ret[$i]['url'] = $file;
             ++$i;
         }
     }
     return $ret;
 }
Пример #3
0
 /**
  * Used to populate backend
  *
  * @param int $limit : Number of item for backend
  *
  * Expects an array containing:
  *    title   : Title for the backend items
  *    link    : Link for the backend items
  *    content : content for the backend items
  *    date    : Date of the backend items
  *
  * @return array
  */
 public function backend($limit)
 {
     $xoops = Xoops::getInstance();
     $i = 0;
     $ret = array();
     $files = \Xoops\Core\Lists\File::getList($xoops->path('modules/codex/'));
     foreach ($files as $file) {
         if (!in_array($file, array('xoops_version.php', 'index.php'))) {
             $ret[$i]['title'] = ucfirst(str_replace('.php', '', $file));
             $ret[$i]['link'] = $xoops->url('modules/codex/' . $file);
             $ret[$i]['content'] = 'Codex module : ' . ucfirst(str_replace('.php', '', $file));
             $ret[$i]['date'] = filemtime($xoops->path('modules/codex/' . $file));
             ++$i;
         }
     }
     return $ret;
 }
Пример #4
0
 public function search($queries, $andor, $limit, $start, $uid)
 {
     $xoops = Xoops::getInstance();
     $queries = implode(' ', (array) $queries);
     $files = \Xoops\Core\Lists\File::getList($xoops->path('modules/codex/'));
     $res = array();
     $i = 0;
     foreach ($files as $file) {
         if (!in_array($file, array('xoops_version.php', 'index.php'))) {
             $fileName = ucfirst(str_replace('.php', '', $file));
             if (stripos($fileName, $queries) !== false) {
                 $res[$i]['link'] = $file;
                 $res[$i]['title'] = $fileName;
                 ++$i;
             }
         }
     }
     return $res;
 }
Пример #5
0
<?php

/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author          trabis <*****@*****.**>
 * @version         $Id$
 */
include dirname(dirname(__DIR__)) . '/mainfile.php';
$xoops = Xoops::getInstance();
$xoops->header();
$files = \Xoops\Core\Lists\File::getList(__DIR__);
foreach ($files as $file) {
    if (!in_array($file, array('xoops_version.php', 'index.php'))) {
        $fileName = ucfirst(str_replace('.php', '', $file));
        echo "<a href={$file}>{$fileName}</a><br/>";
    }
}
$xoops->footer();
Пример #6
0
 /**
  * Get a list of extensions
  *
  * @param string $name      name of captcha looking for
  * @param string $extension extentions for captcha
  *
  * @return array|mixed
  */
 public function getList($name, $extension = "")
 {
     if ($items = \Xoops\Cache::read("captcha_captcha_{$name}")) {
         return $items;
     }
     $file_path = $this->xoops_root_path . "/class/captcha/image/{$name}";
     $files = \Xoops\Core\Lists\File::getList($file_path);
     foreach ($files as $item) {
         if (empty($extension) || preg_match("/(\\.{$extension})\$/i", $item)) {
             $items[] = $item;
         }
     }
     \Xoops\Cache::write("captcha_captcha_{$name}", $items);
     return $items;
 }
Пример #7
0
 /**
  * gets list of all files in a directory
  *
  * @param string $path   filesystem path
  * @param string $prefix prefix added to file names
  *
  * @return array
  */
 public static function getFileListAsArray($path, $prefix = '')
 {
     return \Xoops\Core\Lists\File::getList($path, $prefix);
 }