当前位置: 首页>>代码示例>>PHP>>正文


PHP TikiFilter类代码示例

本文整理汇总了PHP中TikiFilter的典型用法代码示例。如果您正苦于以下问题:PHP TikiFilter类的具体用法?PHP TikiFilter怎么用?PHP TikiFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TikiFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fromInput

 public static function fromInput(JitFilter $input, array $typeInfo)
 {
     $options = new Tracker_Options();
     $options->info = $typeInfo;
     foreach ($typeInfo['params'] as $key => $info) {
         $filter = $info['filter'];
         if (isset($info['count']) && $info['count'] === '*') {
             $rawValue = $input->{$key}->none();
             if ($rawValue !== '') {
                 $values = explode(',', $rawValue);
                 $filter = TikiFilter::get($filter);
                 $values = array_map(array($filter, 'filter'), $values);
             } else {
                 $values = '';
             }
             $options->setParam($key, $values);
         } elseif (isset($info['separator'])) {
             $input->replaceFilter($key, $filter);
             $values = $input->asArray($key, $info['separator']);
             $options->setParam($key, $values);
         } else {
             $options->setParam($key, $input->{$key}->{$filter}());
         }
     }
     return $options;
 }
开发者ID:rjsmelo,项目名称:tiki,代码行数:26,代码来源:Options.php

示例2: filter

 function filter($value)
 {
     $parserlib = TikiLib::lib('parser');
     $noparsed = array();
     $parserlib->plugins_remove($value, $noparsed);
     $value = TikiFilter::get('xss')->filter($value);
     $parserlib->isEditMode = true;
     $parserlib->plugins_replace($value, $noparsed, true);
     $parserlib->isEditMode = false;
     return $value;
 }
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:11,代码来源:WikiContent.php

示例3: action_attach

 function action_attach($input)
 {
     $type = $input->type->text();
     $objectFilter = $this->getObjectFilter($type);
     if (!$objectFilter) {
         throw new Services_Exception(tr('Translation not supported for the specified object type'), 400);
     }
     $source = $input->source->{$objectFilter}();
     $target = $input->target->none();
     $target = end(explode(':', $target, 2));
     $target = TikiFilter::get($objectFilter)->filter($target);
     if (!$source || !$target) {
         throw new Services_Exception(tr('No source or target provided'), 400);
     }
     if (!$this->canAttach($type, $source) || !$this->canAttach($type, $target)) {
         throw new Services_Exception(tr('You do not have permission to attach the selected translations'), 403);
     }
     $succeeded = $this->utilities->insertTranslation($type, $source, $target);
     if (!$succeeded) {
         throw new Services_Exception(tr('Could not attach the translations.'), 409);
     }
     return array('FORWARD' => array('action' => 'manage', 'type' => $type, 'source' => $source));
 }
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:23,代码来源:TranslationController.php

示例4: update_feed

 private function update_feed($rssId, $url, $actions)
 {
     global $tikilib;
     $filter = new DeclFilter();
     $filter->addStaticKeyFilters(array('url' => 'url', 'title' => 'striptags', 'author' => 'striptags', 'description' => 'striptags', 'content' => 'purifier'));
     $guidFilter = TikiFilter::get('url');
     try {
         $content = $tikilib->httprequest($url);
         $feed = Zend_Feed_Reader::importString($content);
     } catch (Zend_Exception $e) {
         $this->modules->update(array('lastUpdated' => $tikilib->now, 'sitetitle' => 'N/A', 'siteurl' => '#'), array('rssId' => $rssId));
         return;
     }
     $siteTitle = TikiFilter::get('striptags')->filter($feed->getTitle());
     $siteUrl = TikiFilter::get('url')->filter($feed->getLink());
     $this->modules->update(array('lastUpdated' => $tikilib->now, 'sitetitle' => $siteTitle, 'siteurl' => $siteUrl), array('rssId' => $rssId));
     foreach ($feed as $entry) {
         // TODO: optimize. Atom entries have an 'updated' element which can be used to only update updated entries
         $guid = $guidFilter->filter($entry->getId());
         $authors = $entry->getAuthors();
         $data = $filter->filter(array('title' => $entry->getTitle(), 'url' => $entry->getLink(), 'description' => $entry->getDescription(), 'content' => $entry->getContent(), 'author' => $authors ? implode(', ', $authors->getValues()) : ''));
         $data['guid'] = $guid;
         if (method_exists($entry, 'getDateCreated') && ($createdDate = $entry->getDateCreated())) {
             $data['publication_date'] = $createdDate->get(Zend_Date::TIMESTAMP);
         } else {
             global $tikilib;
             $data['publication_date'] = $tikilib->now;
         }
         $count = $this->items->fetchCount(array('rssId' => $rssId, 'guid' => $guid));
         if (0 == $count) {
             $this->insert_item($rssId, $data, $actions);
         } else {
             $this->update_item($rssId, $data['guid'], $data);
         }
     }
 }
开发者ID:hurcane,项目名称:tiki-azure,代码行数:36,代码来源:rsslib.php

示例5: isset

    } else {
        if ($blog_data['always_owner'] == 'y') {
            $author = $blog_data['user'];
        } else {
            $author = $user;
        }
        $postId = $bloglib->blog_post($_REQUEST["blogId"], $edit_data, $_REQUEST['excerpt'], $author, $title, isset($_REQUEST['contributions']) ? $_REQUEST['contributions'] : '', $blogpriv, $publishDate, $is_wysiwyg);
        $smarty->assign('postId', $postId);
    }
    if ($prefs['geo_locate_blogpost'] == 'y' && !empty($_REQUEST['geolocation'])) {
        TikiLib::lib('geo')->set_coordinates('blog post', $postId, $_REQUEST['geolocation']);
    }
    // TAG Stuff
    $cat_type = 'blog post';
    $cat_objid = $postId;
    $cat_desc = TikiFilter::get('purifier')->filter(substr($edit_data, 0, 200));
    $cat_name = $title;
    $cat_href = "tiki-view_blog_post.php?postId=" . urlencode($postId);
    $cat_lang = $_REQUEST['lang'];
    include_once "freetag_apply.php";
    include_once "categorize.php";
    require_once 'tiki-sefurl.php';
    $smarty->loadPlugin('smarty_modifier_sefurl');
    $url = smarty_modifier_sefurl($postId, 'blogpost');
    header("location: {$url}");
    exit;
}
if ($contribution_needed) {
    $smarty->assign('title', $_REQUEST["title"]);
    $smarty->assign('parsed_data', $tikilib->parse_data($_REQUEST['data'], array('is_html' => $is_wysiwyg)));
    $smarty->assign('data', $_REQUEST['data']);
开发者ID:jkimdon,项目名称:cohomeals,代码行数:31,代码来源:tiki-blog_post.php

示例6: dir_replace_site

 /**
  * @param $siteId
  * @param $name
  * @param $description
  * @param $url
  * @param $country
  * @param $isValid
  * @return mixed
  */
 function dir_replace_site($siteId, $name, $description, $url, $country, $isValid)
 {
     global $prefs;
     $name = TikiFilter::get('striptags')->filter($name);
     $description = TikiFilter::get('striptags')->filter($description);
     $url = TikiFilter::get('url')->filter($url);
     $country = TikiFilter::get('word')->filter($country);
     if ($siteId) {
         $query = "update `tiki_directory_sites` set `name`=?, `description`=?, `url`=?, `country`=?, `isValid`=?, `lastModif`=?  where `siteId`=?";
         $this->query($query, array($name, $description, $url, $country, $isValid, (int) $this->now, (int) $siteId));
     } else {
         $query = "insert into `tiki_directory_sites`(`name`,`description`,`url`,`country`,`isValid`,`hits`,`created`,`lastModif`) values(?,?,?,?,?,?,?,?)";
         $this->query($query, array($name, $description, $url, $country, $isValid, 0, (int) $this->now, (int) $this->now));
         $siteId = $this->getOne("select max(siteId) from `tiki_directory_sites` where `created`=? and `name`=?", array((int) $this->now, $name));
         if ($prefs['cachepages'] == 'y') {
             $this->cache_url($url);
         }
     }
     require_once 'lib/search/refresh-functions.php';
     refresh_index('directory_sites', $siteId);
     return $siteId;
 }
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:31,代码来源:dirlib.php

示例7: smarty_function_object_link_external

function smarty_function_object_link_external($smarty, $link_orig, $title = null, $type = null)
{
    $cachelib = TikiLib::lib('cache');
    $tikilib = TikiLib::lib('tiki');
    if (substr($link_orig, 0, 4) === 'www.') {
        $link = 'http://' . $link_orig;
    } else {
        $link = $link_orig;
    }
    if (!$title) {
        if (!($title = $cachelib->getCached($link, 'object_link_ext_title'))) {
            $body = $tikilib->httprequest($link);
            if (preg_match('|<title>(.+)</title>|', $body, $parts)) {
                $title = TikiFilter::get('text')->filter($parts[1]);
            } else {
                $title = $link_orig;
            }
            $cachelib->cacheItem($link, $title, 'object_link_ext_title');
        }
    }
    $smarty->loadPlugin('smarty_modifier_escape');
    $escapedHref = smarty_modifier_escape($link);
    $escapedLink = smarty_modifier_escape($link_orig);
    $escapedTitle = smarty_modifier_escape($title);
    if ($type == 'external_extended' && "{$link_orig}" != "{$title}") {
        $data = '<a rel="external" href="' . $escapedHref . '">' . $escapedLink . '</a>' . "<div class='link_extend_title'><em>" . $escapedTitle . "</em></div>";
    } else {
        $data = '<a rel="external" href="' . $escapedHref . '">' . $escapedTitle . '</a>';
    }
    return $data;
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:31,代码来源:function.object_link.php

示例8: header

/*
 * This is included in the html generated for each wiki page. It is included for each plugin used on a wiki page.
 * The include is of the form <script type="text/javascript" src="tiki-jsplugin.php?plugin=googledoc"></script>
 * If no plugin name is given, a list of all the plugins is used instead
 * The java script generated defines tiki_plugins["pluginname"] with meta data for the parameters of the plugin.
 * This is then used to allow a nice way for the editor of the page to use a form to edit the plug-in when they
 * click the little edit icon next to the plug-ins generated html.
 *
 * Cached by language to allow translations (tiki 5)
 */
header('content-type: application/x-javascript');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600 * 24 * 365 * 10) . ' GMT');
require_once 'tiki-filter-base.php';
$filter = TikiFilter::get('xss');
$_REQUEST['plugin'] = isset($_GET['plugin']) ? $_GET['plugin'] = $filter->filter($_GET['plugin']) : '';
$filter = TikiFilter::get('alpha');
$_REQUEST['language'] = isset($_GET['language']) ? $_GET['language'] = $filter->filter($_GET['language']) : '';
$all = empty($_REQUEST['plugin']);
$files = array();
if ($all) {
    $cache = "temp/cache/wikiplugin_ALL_" . $_REQUEST['language'];
    if (file_exists($cache)) {
        readfile($cache);
        exit;
    }
    include 'tiki-setup.php';
    $parserlib = TikiLib::lib('parser');
    $plugins = $parserlib->plugin_get_list();
} else {
    $plugin = basename($_REQUEST['plugin']);
    $cache = 'temp/cache/wikiplugin_' . $plugin . '_' . $_REQUEST['language'];
开发者ID:hurcane,项目名称:tiki-azure,代码行数:31,代码来源:tiki-jsplugin.php

示例9: __construct

 function __construct($filter)
 {
     $this->filter = TikiFilter::get($filter);
 }
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:4,代码来源:CatchAllFilterRule.php

示例10: add_article_type_attribute

 function add_article_type_attribute($artType, $attributeName)
 {
     $relationlib = TikiLib::lib('relation');
     $attributelib = TikiLib::lib('attribute');
     $fullAttributeName = TikiFilter::get('attribute_type')->filter(trim('tiki.article.' . $attributeName));
     $relationId = $relationlib->add_relation('tiki.article.attribute', 'articletype', $artType, 'attribute', $fullAttributeName);
     if (!$relationId) {
         return 0;
     } else {
         $attributelib->set_attribute('relation', $relationId, 'tiki.relation.target', $attributeName);
         return $relationId;
     }
 }
开发者ID:ameoba32,项目名称:tiki,代码行数:13,代码来源:artlib.php

示例11: get_valid

 /**
  * @param $name
  * @return mixed
  */
 private function get_valid($name)
 {
     $filter = TikiFilter::get('attribute_type');
     return $filter->filter($name);
 }
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:9,代码来源:attributelib.php

示例12: parseOptions

 function parseOptions($raw, $typeInfo)
 {
     $out = array();
     foreach ($typeInfo['params'] as $key => $info) {
         if (isset($info['count']) && $info['count'] === '*') {
             // There is a possibility that * does not mean all of the remaining, to apply reasonable heuristic
             $filter = TikiFilter::get($info['filter']);
             $outarray = array();
             foreach ($raw as $r) {
                 $filtered = $filter->filter($r);
                 if (strcmp($filtered, $r) == 0) {
                     $outarray[] = array_shift($raw);
                 } else {
                     break;
                 }
             }
             $out[$key] = implode(',', $outarray);
         } else {
             $out[$key] = array_shift($raw);
         }
     }
     return $out;
 }
开发者ID:railfuture,项目名称:tiki-website,代码行数:23,代码来源:Utilities.php

示例13: getFilter

 function getFilter($key)
 {
     return TikiFilter::get($this->rules[$key]);
 }
开发者ID:jkimdon,项目名称:cohomeals,代码行数:4,代码来源:StaticKeyFilterRule.php

示例14: _getTextareaValue

 private function _getTextareaValue($info, $data)
 {
     $name = $info['preference'];
     if (isset($info['filter']) && ($filter = TikiFilter::get($info['filter']))) {
         $value = $filter->filter($data[$name]);
     } else {
         $value = $data[$name];
     }
     $value = str_replace("\r", "", $value);
     if (isset($info['unserialize'])) {
         $fnc = $info['unserialize'];
         return $fnc($value);
     } else {
         return $value;
     }
 }
开发者ID:ameoba32,项目名称:tiki,代码行数:16,代码来源:prefslib.php

示例15: plugin_apply_filters

 private function plugin_apply_filters($name, &$data, &$args, $parseOptions)
 {
     global $tikilib;
     $info = $this->plugin_info($name);
     $default = TikiFilter::get(isset($info['defaultfilter']) ? $info['defaultfilter'] : 'xss');
     // Apply filters on the body
     $filter = isset($info['filter']) ? TikiFilter::get($info['filter']) : $default;
     //$data = TikiLib::htmldecode($data);		// jb 9.0 commented out in fix for html entitles
     $data = $filter->filter($data);
     if (isset($parseOptions) && (!empty($parseOptions['is_html']) && !$parseOptions['is_html'])) {
         $noparsed = array('data' => array(), 'key' => array());
         $this->strip_unparsed_block($data, $noparsed);
         $data = str_replace(array('<', '>'), array('&lt;', '&gt;'), $data);
         foreach ($noparsed['data'] as &$instance) {
             $instance = '~np~' . $instance . '~/np~';
         }
         unset($instance);
         $data = str_replace($noparsed['key'], $noparsed['data'], $data);
     }
     // Make sure all arguments are declared
     $params = $info['params'];
     if (!isset($info['extraparams']) && is_array($params)) {
         $args = array_intersect_key($args, $params);
     }
     // Apply filters on values individually
     if (!empty($args)) {
         foreach ($args as $argKey => &$argValue) {
             if (!isset($params[$argKey])) {
                 continue;
                 // extra params
             }
             $paramInfo = $params[$argKey];
             $filter = isset($paramInfo['filter']) ? TikiFilter::get($paramInfo['filter']) : $default;
             $argValue = TikiLib::htmldecode($argValue);
             if (isset($paramInfo['separator'])) {
                 $vals = array();
                 $vals = $tikilib->array_apply_filter($tikilib->multi_explode($paramInfo['separator'], $argValue), $filter);
                 $argValue = array_values($vals);
             } else {
                 $argValue = $filter->filter($argValue);
             }
         }
     }
 }
开发者ID:railfuture,项目名称:tiki-website,代码行数:44,代码来源:parserlib.php


注:本文中的TikiFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。