當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XoopsLoad::addMap方法代碼示例

本文整理匯總了PHP中XoopsLoad::addMap方法的典型用法代碼示例。如果您正苦於以下問題:PHP XoopsLoad::addMap方法的具體用法?PHP XoopsLoad::addMap怎麽用?PHP XoopsLoad::addMap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XoopsLoad的用法示例。


在下文中一共展示了XoopsLoad::addMap方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_xoopsCodeDecode

 public function test_xoopsCodeDecode()
 {
     $this->markTestSkipped('now protected - move to extension test');
     $path = \XoopsBaseConfig::get('root-path');
     if (!class_exists('Comments', false)) {
         \XoopsLoad::addMap(array('comments' => $path . '/modules/comments/class/helper.php'));
     }
     if (!class_exists('MenusDecorator', false)) {
         \XoopsLoad::addMap(array('menusdecorator' => $path . '/modules/menus/class/decorator.php'));
     }
     if (!class_exists('MenusBuilder', false)) {
         \XoopsLoad::addMap(array('menusbuilder' => $path . '/modules/menus/class/builder.php'));
     }
     $class = $this->myClass;
     $sanitizer = $class::getInstance();
     $host = 'monhost.fr';
     $site = 'MonSite';
     $text = '[siteurl="' . $host . '"]' . $site . '[/siteurl]';
     $message = $this->decode_check_level($sanitizer, $text);
     $xoops_url = \XoopsBaseConfig::get('url');
     $this->assertEquals('<a href="' . $xoops_url . '/' . $host . '" title="">' . $site . '</a>', $message);
     $text = '[siteurl=\'' . $host . '\']' . $site . '[/siteurl]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="' . $xoops_url . '/' . $host . '" title="">' . $site . '</a>', $message);
     $text = '[url="http://' . $host . '"]' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="http://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
     $text = '[url=\'http://' . $host . '\']' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="http://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
     $text = '[url="https://' . $host . '"]' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="https://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
     $text = '[url=\'https://' . $host . '\']' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="https://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
     $text = '[url="ftp://' . $host . '"]' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="ftp://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
     $text = '[url=\'ftp://' . $host . '\']' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="ftp://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
     $text = '[url="ftps://' . $host . '"]' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="ftps://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
     $text = '[url=\'ftps://' . $host . '\']' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="ftps://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
     $text = '[url="' . $host . '"]' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="http://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
     $text = '[url=\'' . $host . '\']' . $site . '[/url]';
     $message = $this->decode_check_level($sanitizer, $text);
     $this->assertEquals('<a href="http://' . $host . '" rel="external" title="">' . $site . '</a>', $message);
 }
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:55,代碼來源:module.textsanitizerTest.php

示例2: test_translateTheme

 public function test_translateTheme()
 {
     $path = \XoopsBaseConfig::get('root-path');
     if (!class_exists('Comments', false)) {
         \XoopsLoad::addMap(array('comments' => $path . '/modules/comments/class/helper.php'));
     }
     if (!class_exists('MenusDecorator', false)) {
         \XoopsLoad::addMap(array('menusdecorator' => $path . '/modules/menus/class/decorator.php'));
     }
     $class = $this->myClass;
     $key = 'key';
     $x = $class::translateTheme($key);
     $this->assertSame($key, $x);
 }
開發者ID:redmexico,項目名稱:XoopsCore,代碼行數:14,代碼來源:LocaleTest.php

示例3: startAutoloader

 /**
  * startAutoloader enable the autoloader
  *
  * @param string $path path of the library directory where composer managed
  *                     vendor directory can be found.
  * @return void
  */
 public static function startAutoloader($path)
 {
     static $libPath = null;
     if ($libPath === null) {
         $loaderPath = $path . '/vendor/autoload.php';
         if (self::fileExists($loaderPath)) {
             $libPath = $path;
             include $loaderPath;
         }
         XoopsLoad::addMap(XoopsLoad::loadCoreConfig());
         spl_autoload_register(array('XoopsLoad', 'load'));
     }
 }
開發者ID:elitet,項目名稱:XoopsCore,代碼行數:20,代碼來源:xoopsload.php

示例4: eventCoreIncludeCommonClassmaps

 /**
  * listen for core.include.common.classmaps
  * add any module specific class map entries
  *
  * @param mixed $args not used
  *
  * @return void
  */
 public static function eventCoreIncludeCommonClassmaps($args)
 {
     $path = dirname(__DIR__);
     XoopsLoad::addMap(array('menus' => $path . '/class/helper.php', 'menusbuilder' => $path . '/class/builder.php', 'menusdecorator' => $path . '/class/decorator.php'));
 }
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:13,代碼來源:preload.php

示例5: eventCoreIncludeCommonClassmaps

 /**
  * add any module specific class map entries
  *
  * @param mixed $args not used
  *
  * @return void
  */
 public static function eventCoreIncludeCommonClassmaps($args)
 {
     $path = dirname(__DIR__);
     XoopsLoad::addMap(array('monologlogger' => $path . '/class/monologlogger.php'));
 }
開發者ID:RanLee,項目名稱:XoopsCore,代碼行數:12,代碼來源:preload.php

示例6: displayBanner

 /**
  * Display banner
  *
  * @param int    $nb_banner number of banners
  * @param string $align     alignment H,V
  * @param array  $client    client ids to include
  * @param string $ids       SQL IN clause for banner_bid column
  *
  * @return string
  */
 public function displayBanner($nb_banner = 1, $align = 'H', $client = array(), $ids = '')
 {
     $xoops = Xoops::getInstance();
     XoopsLoad::addMap(array('banners' => __DIR__ . '/helper.php'));
     $helper = Banners::getInstance();
     if ($xoops->isActiveModule('banners')) {
         // Get banners handler
         $banner_Handler = $helper->getHandlerBanner();
         // Display banner
         $criteria = new CriteriaCompo();
         $criteria->add(new Criteria('banner_status', 0, '!='));
         $sort = 'sqlite' === \XoopsBaseConfig::get('db-type') ? 'RANDOM()' : 'RAND()';
         $criteria->setSort($sort);
         if (!empty($client)) {
             if (!in_array(0, $client)) {
                 $criteria->add(new Criteria('banner_cid', '(' . implode(',', $client) . ')', 'IN'));
             }
         }
         if ($ids == '') {
             $criteria->setLimit($nb_banner);
             $criteria->setStart(0);
         } else {
             $criteria->add(new Criteria('banner_bid', '(' . $ids . ')', 'IN'));
         }
         $banner_arr = $banner_Handler->getAll($criteria);
         $numrows = count($banner_arr);
         $bannerobject = '';
         if ($numrows > 0) {
             foreach (array_keys($banner_arr) as $i) {
                 $imptotal = $banner_arr[$i]->getVar("banner_imptotal");
                 $impmade = $banner_arr[$i]->getVar("banner_impmade");
                 $htmlbanner = $banner_arr[$i]->getVar("banner_htmlbanner");
                 $htmlcode = $banner_arr[$i]->getVar("banner_htmlcode");
                 $imageurl = $banner_arr[$i]->getVar("banner_imageurl");
                 $bid = $banner_arr[$i]->getVar("banner_bid");
                 $clickurl = $banner_arr[$i]->getVar("banner_clickurl");
                 /**
                  * Print the banner
                  */
                 if ($htmlbanner) {
                     $bannerobject .= $htmlcode;
                 } else {
                     if (stristr($imageurl, '.swf')) {
                         $bannerobject .= '<a href="' . \XoopsBaseConfig::get('url') . '/modules/banners/index.php?op=click&amp;bid=' . $bid . '" rel="external" title="' . $clickurl . '"></a>' . '<object type="application/x-shockwave-flash" width="468" height="60" data="' . $imageurl . '" style="z-index:100;">' . '<param name="movie" value="' . $imageurl . '" />' . '<param name="wmode" value="opaque" />' . '</object>';
                     } else {
                         $bannerobject .= '<a href="' . \XoopsBaseConfig::get('url') . '/modules/banners/index.php?op=click&amp;bid=' . $bid . '" rel="external" title="' . $clickurl . '"><img src="' . $imageurl . '" alt="' . $clickurl . '" /></a>';
                     }
                 }
                 if ($align === 'V') {
                     $bannerobject .= '<br /><br />';
                 } else {
                     $bannerobject .= '&nbsp;';
                 }
                 if ($helper->getConfig('banners_myip') == $xoops->getEnv('REMOTE_ADDR')) {
                     // EMPTY
                 } else {
                     /**
                      * Check if this impression is the last one
                      */
                     $impmade = $impmade + 1;
                     $qb = $xoops->db()->createXoopsQueryBuilder();
                     if ($imptotal > 0 && $impmade >= $imptotal) {
                         $query = $qb->updatePrefix('banners_banner')->set('banner_impmade', ':impr')->set('banner_status', ':stat')->set('banner_dateend', ':dateend')->where('banner_bid = :bid')->setParameter(':impr', $impmade, \PDO::PARAM_INT)->setParameter(':stat', 0, \PDO::PARAM_INT)->setParameter(':dateend', time(), \PDO::PARAM_INT)->setParameter(':bid', $bid, \PDO::PARAM_INT);
                         $result = $query->execute();
                     } else {
                         $query = $qb->updatePrefix('banners_banner')->set('banner_impmade', ':impr')->where('banner_bid = :bid')->setParameter(':impr', $impmade, \PDO::PARAM_INT)->setParameter(':bid', $bid, \PDO::PARAM_INT);
                         $result = $query->execute();
                     }
                 }
             }
             return $bannerobject;
         }
     }
 }
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:84,代碼來源:bannerrender.php

示例7: copyrighted

/*
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.
*/
/**
 *  Publisher class
 *
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         GNU GPL V2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         Publisher
 * @since           1.0
 * @author          trabis <lusopoemas@gmail.com>
 * @version         $Id$
 */
$xoops = \Xoops::getInstance();
define("PUBLISHER_DIRNAME", basename(dirname(__DIR__)));
define("PUBLISHER_URL", $xoops->url('modules/' . PUBLISHER_DIRNAME));
define("PUBLISHER_ADMIN_URL", PUBLISHER_URL . '/admin');
define("PUBLISHER_UPLOADS_URL", $xoops->url('uploads/' . PUBLISHER_DIRNAME));
define("PUBLISHER_ROOT_PATH", $xoops->path('modules/' . PUBLISHER_DIRNAME));
define("PUBLISHER_UPLOADS_PATH", $xoops->path('uploads/' . PUBLISHER_DIRNAME));
$path = dirname(__DIR__);
XoopsLoad::addMap(array('publishermetagen' => $path . '/class/metagen.php', 'publisher' => $path . '/class/helper.php', 'publisherutils' => $path . '/class/utils.php', 'publisherblockform' => $path . '/class/blockform.php'));
$publisher = Publisher::getInstance();
$publisher->loadLanguage('common');
XoopsLoad::loadFile($publisher->path('include/constants.php'));
開發者ID:dazzlesoftware,項目名稱:XoopsCore,代碼行數:31,代碼來源:common.php

示例8: xoops_module_install_banners

/**
 * banner module install suplement
 *
 * @param XoopsModule &$module module being installed
 *
 * @return boolean true if no error
 */
function xoops_module_install_banners(&$module)
{
    $xoops = Xoops::getInstance();
    //$xoops->db();
    //global $xoopsDB;
    XoopsLoad::addMap(array('banners' => dirname(__DIR__) . '/class/helper.php'));
    $helper = Banners::getInstance();
    // Get handler
    $banner_Handler = $helper->getHandlerBanner();
    $client_Handler = $helper->getHandlerBannerclient();
    // update client
    /*$sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("bannerclient");
      $result = $xoopsDB->queryF($sql);
      if (($rows = $xoopsDB->getRowsNum($result)) == 7) {
          $sql = "SELECT * FROM " . $xoopsDB->prefix("bannerclient");
          $result = $xoopsDB->query($sql);
          while ($myrow = $xoopsDB->fetchArray($result)) {
              $extrainfo = $myrow['contact'] . ' - ' . $myrow['email'] . ' - ' . $myrow['login'] . ' - ' . $myrow['passwd'] . ' - ' . $myrow['extrainfo'];
              $sql = "UPDATE `" . $xoopsDB->prefix("bannerclient") . "` SET `extrainfo` = '" .  $extrainfo . "' WHERE `cid` = " . $myrow['cid'];
              $xoopsDB->queryF($sql);
          }
          $sql = "ALTER TABLE " . $xoopsDB->prefix("bannerclient") . " DROP contact, DROP email, DROP login, DROP passwd";
          $xoopsDB->queryF($sql);
          $sql = "ALTER TABLE " . $xoopDB->prefix("bannerclient") . " ADD `uid` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `cid`";
          $xoopsDB->queryF($sql);
      }*/
    // update banner
    /*$sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("banner");
      $result = $xoopsDB->queryF($sql);
      if (($rows = $xoopsDB->getRowsNum($result)) == 10) {
          $sql = "ALTER TABLE " . $xoopsDB->prefix("banner") . " CHANGE `date` `datestart` INT( 10 ) NOT NULL DEFAULT '0'";
          $xoopsDB->queryF($sql);
          $sql = "ALTER TABLE " . $xoopsDB->prefix("banner") . " ADD `dateend` INT( 10 ) NOT NULL DEFAULT '0' AFTER `datestart`";
          $xoopsDB->queryF($sql);
          $sql = "ALTER TABLE " . $xoopsDB->prefix("banner") . " ADD `status` TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER `htmlcode`";
          $xoopsDB->queryF($sql);
      }*/
    // update bannerfinish
    /*$sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("bannerfinish");
      $result = $xoopsDB->queryF($sql);
      if (($rows = $xoopsDB->getRowsNum($result)) == 6) {
          $sql = "SELECT * FROM " . $xoopsDB->prefix("bannerfinish");
          $result = $xoopsDB->query($sql);
          while ($myrow = $xoopsDB->fetchArray($result)) {
              $sql = "INSERT INTO `" . $xoopsDB->prefix("banner") . "` (`cid`, `imptotal`, `impmade`, `clicks`, `imageurl`, `clickurl`, `datestart`, `dateend`, `htmlbanner`, `htmlcode`, `status`) VALUES (" . $myrow['cid'] . ", 0, " . $myrow['impressions'] . ", " . $myrow['clicks'] . ", 0, '', " . $myrow['datestart'] . ", " . $myrow['dateend'] . ", 0, '', 0)";
              $xoopsDB->queryF($sql);
          }
      }*/
    /* this should be in system upgrade, not module install
        TODO: Add to upgrade script and remove from here
        // delete banners and my_ip
        $sql = "DELETE FROM " . $xoopsDB->prefix("config") . " WHERE `conf_name` = 'banners'";
        $xoopsDB->queryF($sql);
        $sql = "DELETE FROM " . $xoopsDB->prefix("config") . " WHERE `conf_name` = 'my_ip'";
        $xoopsDB->queryF($sql);
    */
    $xoops_root_path = \XoopsBaseConfig::get('root-path');
    $xoops_upload_url = \XoopsBaseConfig::get('uploads-url');
    // create folder "banners"
    $dir = $xoops_root_path . "/uploads/banners";
    if (!is_dir($dir)) {
        mkdir($dir, 0777);
        chmod($dir, 0777);
    }
    //Copy index.html
    $file = $xoops_root_path . "/uploads/banners/index.html";
    if (!is_file($file)) {
        copy($xoops_root_path . "/modules/banners/images/index.html", $file);
    }
    //Copy blank.gif
    $file = $xoops_root_path . "/uploads/banners/blank.gif";
    if (!is_file($file)) {
        copy($xoops_root_path . "/uploads/blank.gif", $file);
    }
    //Copy .htaccess
    $file = $xoops_root_path . "/uploads/banners/.htaccess";
    if (!is_file($file)) {
        copy($xoops_root_path . "/uploads/.htaccess", $file);
    }
    /* this should be in system upgrade, not module install
        TODO: Add to upgrade script and remove from here
        // Copy banner to banners_banner
        $dbManager = new XoopsDatabaseManager();
        $map = array(
            'bid'        => 'banner_bid',
            'cid'        => 'banner_cid',
            'imptotal'   => 'banner_imptotal',
            'impmade'    => 'banner_impmade',
            'clicks'     => 'banner_clicks',
            'imageurl'   => 'banner_imageurl',
            'clickurl'   => 'banner_clickurl',
            'date'       => 'banner_datestart',
            'htmlbanner' => 'banner_htmlbanner',
//.........這裏部分代碼省略.........
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:101,代碼來源:install.php

示例9: eventCoreIncludeCommonEnd

 public static function eventCoreIncludeCommonEnd($args)
 {
     $path = dirname(__DIR__);
     XoopsLoad::addMap(array('images' => $path . '/class/helper.php'));
 }
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:5,代碼來源:preload.php

示例10: copyrighted

<?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.
*/
/**
 *  Alumni class
 *
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         Alumni
 * @since           1.0
 * @author          trabis <lusopoemas@gmail.com>
 * @version         $Id: common.php 10747 2013-01-10 20:55:39Z trabis $
 */
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
define('ALUMNI_DIRNAME', basename(dirname(__DIR__)));
define('ALUMNI_URL', XOOPS_URL . '/modules/' . ALUMNI_DIRNAME);
define('ALUMNI_ADMIN_URL', ALUMNI_URL . '/admin');
define('ALUMNI_UPLOADS_URL', XOOPS_URL . '/uploads/' . ALUMNI_DIRNAME);
define('ALUMNI_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . ALUMNI_DIRNAME);
define('ALUMNI_UPLOADS_PATH', XOOPS_ROOT_PATH . '/uploads/' . ALUMNI_DIRNAME);
$path = dirname(__DIR__);
XoopsLoad::addMap(array('alumnisession' => $path . '/class/session.php', 'alumni' => $path . '/class/helper.php', 'alumniblockform' => $path . '/class/blockform.php'));
$alumni = Alumni::getInstance();
開發者ID:jlm69,項目名稱:alumni-26x,代碼行數:31,代碼來源:common.php

示例11: eventCoreIncludeCommonClassmaps

 static function eventCoreIncludeCommonClassmaps($args)
 {
     $path = dirname(__DIR__);
     XoopsLoad::addMap(array('alumnimetagen' => $path . '/class/metagen.php', 'alumni' => $path . '/class/helper.php'));
 }
開發者ID:jlm69,項目名稱:alumni-26x,代碼行數:5,代碼來源:preload.php

示例12: loadMailerLocale

 /**
  * @return  boolean
  */
 public static function loadMailerLocale()
 {
     $xoops = Xoops::getInstance();
     $locales = self::getUserLocales();
     foreach ($locales as $locale) {
         $fullPath = $xoops->path("locale/{$locale}/mailer.php");
         if (XoopsLoad::fileExists($fullPath)) {
             XoopsLoad::addMap(array(strtolower('XoopsMailerLocale') => $fullPath));
             return true;
         }
     }
     return false;
 }
開發者ID:redmexico,項目名稱:XoopsCore,代碼行數:16,代碼來源:Locale.php

示例13: eventCoreIncludeCommonClassmaps

 /**
  * listen for core.include.common.classmaps
  * add any module specific class map entries
  *
  * @param mixed $args not used
  *
  * @return void
  */
 public static function eventCoreIncludeCommonClassmaps($args)
 {
     $path = dirname(__DIR__);
     XoopsLoad::addMap(array('comments' => $path . '/class/helper.php', 'commentscommentrenderer' => $path . '/class/commentrenderer.php'));
 }
開發者ID:dazzlesoftware,項目名稱:XoopsCore,代碼行數:13,代碼來源:preload.php

示例14: eventCoreIncludeCommonClassmaps

 static function eventCoreIncludeCommonClassmaps($args)
 {
     $path = dirname(__DIR__);
     XoopsLoad::addMap(array('publishermetagen' => $path . '/class/metagen.php', 'publisher' => $path . '/class/helper.php', 'publisherutils' => $path . '/class/utils.php', 'publisherblockform' => $path . '/class/blockform.php'));
 }
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:5,代碼來源:preload.php

示例15: eventSystemPreferencesSave

 /**
  * system.preferences.save
  *
  * @param mixed $args arguments supplied to triggerEvent
  *
  * @return void
  */
 public static function eventSystemPreferencesSave($args)
 {
     XoopsLoad::addMap(array('legacylogger' => dirname(__DIR__) . '/class/legacylogger.php'));
 }
開發者ID:RanLee,項目名稱:XoopsCore,代碼行數:11,代碼來源:preload.php


注:本文中的XoopsLoad::addMap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。