本文整理汇总了PHP中smarty_modifier_sefurl函数的典型用法代码示例。如果您正苦于以下问题:PHP smarty_modifier_sefurl函数的具体用法?PHP smarty_modifier_sefurl怎么用?PHP smarty_modifier_sefurl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smarty_modifier_sefurl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_select
function action_select($input)
{
$categlib = TikiLib::lib('categ');
$objectlib = TikiLib::lib('object');
$smarty = TikiLib::lib('smarty');
$type = $input->type->text();
$object = $input->object->text();
$perms = Perms::get($type, $object);
if (!$perms->modify_object_categories) {
throw new Services_Exception_Denied('Not allowed to modify categories');
}
$input->replaceFilter('subset', 'int');
$subset = $input->asArray('subset', ',');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$smarty->loadPlugin('smarty_modifier_sefurl');
$name = $objectlib->get_title($type, $object);
$url = smarty_modifier_sefurl($object, $type);
$targetCategories = (array) $input->categories->int();
$count = $categlib->update_object_categories($targetCategories, $object, $type, '', $name, $url, $subset, false);
}
$categories = $categlib->get_object_categories($type, $object);
return array('subset' => implode(',', $subset), 'categories' => array_combine($subset, array_map(function ($categId) use($categories) {
return array('name' => TikiLib::lib('object')->get_title('category', $categId), 'selected' => in_array($categId, $categories));
}, $subset)));
}
示例2: action_list
function action_list($input)
{
global $prefs;
$unifiedsearchlib = TikiLib::lib('unifiedsearch');
$index = $unifiedsearchlib->getIndex();
$dataSource = $unifiedsearchlib->getDataSource();
$start = 'tracker_field_' . $input->beginField->word();
$end = 'tracker_field_' . $input->endField->word();
if ($resource = $input->resourceField->word()) {
$resource = 'tracker_field_' . $resource;
}
if ($coloring = $input->coloringField->word()) {
$coloring = 'tracker_field_' . $coloring;
}
$query = $unifiedsearchlib->buildQuery(array());
$query->filterRange($input->start->int(), $input->end->int(), array($start, $end));
$query->setRange(0, $prefs['unified_lucene_max_result']);
if ($body = $input->filters->none()) {
$builder = new Search_Query_WikiBuilder($query);
$builder->apply(WikiParser_PluginMatcher::match($body));
}
$result = $query->search($index);
$result = $dataSource->getInformation($result, array('title', $start, $end));
$response = array();
$smarty = TikiLib::lib('smarty');
$smarty->loadPlugin('smarty_modifier_sefurl');
foreach ($result as $row) {
$item = Tracker_Item::fromId($row['object_id']);
$response[] = array('id' => $row['object_id'], 'trackerId' => isset($row['tracker_id']) ? $row['tracker_id'] : null, 'title' => $row['title'], 'description' => '', 'url' => smarty_modifier_sefurl($row['object_id'], $row['object_type']), 'allDay' => false, 'start' => (int) $row[$start], 'end' => (int) $row[$end], 'editable' => $item->canModify(), 'color' => $this->getColor(isset($row[$coloring]) ? $row[$coloring] : ''), 'textColor' => '#000', 'resource' => $resource && isset($row[$resource]) ? $row[$resource] : '');
}
return $response;
}
示例3: smarty_block_title
function smarty_block_title($params, $content, $template, &$repeat)
{
global $prefs, $tiki_p_view_templates, $tiki_p_edit_templates, $tiki_p_admin;
if ($repeat || empty($content)) {
return;
}
$template->loadPlugin('smarty_function_icon');
$template->loadPlugin('smarty_modifier_sefurl');
$template->loadPlugin('smarty_modifier_escape');
if (!isset($params['help'])) {
$params['help'] = '';
}
if (!isset($params['admpage'])) {
$params['admpage'] = '';
}
if (!isset($params['actions'])) {
$params['actions'] = '';
}
// Set the variable for the HTML title tag
$template->smarty->assign('headtitle', $content);
$class = '';
$current = current_object();
if (!isset($params['url'])) {
$params['url'] = smarty_modifier_sefurl($current['object'], $current['type']);
}
$metadata = '';
$coordinates = TikiLib::lib('geo')->get_coordinates($current['type'], $current['object']);
if ($coordinates) {
$class = ' geolocated primary';
$metadata = " data-geo-lat=\"{$coordinates['lat']}\" data-geo-lon=\"{$coordinates['lon']}\"";
if (isset($coordinates['zoom'])) {
$metadata .= " data-geo-zoom=\"{$coordinates['zoom']}\"";
}
}
$html = '<h1 class="pagetitle">';
$html .= '<a class="' . $class . '"' . $metadata . ' href="' . $params['url'] . '">' . smarty_modifier_escape($content) . "</a>\n";
if ($template->getTemplateVars('print_page') != 'y') {
if ($prefs['feature_help'] == 'y' && $prefs['helpurl'] != '' && $params['help'] != '') {
$html .= '<a href="';
$html .= $prefs['helpurl'] . rawurlencode($params['help']) . '" class="tips btn btn-link" title="' . smarty_modifier_escape($content) . '|' . tra('Help page') . '" target="tikihelp">' . smarty_function_icon(array('name' => 'help'), $template) . "</a>\n";
}
if ($prefs['feature_edit_templates'] == 'y' && $tiki_p_edit_templates == 'y' && ($tpl = $template->getTemplateVars('mid'))) {
$html .= '<a href="tiki-edit_templates.php?template=';
$html .= $tpl . '" class="tips btn btn-link" title="' . tra('View or edit tpl') . '|' . htmlspecialchars($content) . '">' . smarty_function_icon(array('name' => 'edit'), $template) . "</a>\n";
} elseif ($prefs['feature_view_tpl'] == 'y' && $tiki_p_view_templates == 'y' && ($tpl = $template->getTemplateVars('mid'))) {
$html .= '<a href="tiki-edit_templates.php?template=';
$html .= $tpl . '" class="tips btn btn-link" title="' . tra('View tpl') . '|' . htmlspecialchars($content) . '">' . smarty_function_icon(array('name' => 'view'), $template) . "</a>\n";
}
if ($tiki_p_admin == 'y' && $params['admpage'] != '') {
$html .= '<a class="tips btn btn-link" href="tiki-admin.php?page=';
$html .= $params['admpage'] . '" title="' . htmlspecialchars($content) . '|' . tra('Settings') . '">' . smarty_function_icon(array('name' => 'settings'), $template) . "</a>\n";
}
if ($params['actions'] != '') {
$html .= $params['actions'];
}
}
$html .= '</h1>';
return $html;
}
示例4: getData
function getData($objectType, $objectId, Search_Type_Factory_Interface $typeFactory, array $data = array())
{
if (isset($data['url'])) {
return false;
}
$url = smarty_modifier_sefurl($objectId, $objectType);
return array('url' => $typeFactory->identifier($url));
}
示例5: getGroups
function getGroups($token, $entry, $parameters)
{
// Process deletion of temporary users that are created via tokens
$usersToDelete = $this->db->fetchAll('SELECT tokenId, userPrefix FROM tiki_auth_tokens
WHERE (timeout != -1 AND UNIX_TIMESTAMP(creation) + timeout < UNIX_TIMESTAMP()) OR `hits` = 0');
foreach ($usersToDelete as $del) {
TikiLib::lib('user')->remove_temporary_user($del['userPrefix'] . $del['tokenId']);
}
$this->db->query('DELETE FROM tiki_auth_tokens
WHERE (timeout != -1 AND UNIX_TIMESTAMP(creation) + timeout < UNIX_TIMESTAMP()) OR `hits` = 0');
$data = $this->db->query('SELECT tokenId, entry, parameters, groups, email, createUser, userPrefix FROM tiki_auth_tokens WHERE token = ? AND token = ' . self::SCHEME, array($token))->fetchRow();
global $prefs, $full, $smarty, $tikiroot;
// $full defined in route.php
$sefurl = '';
if ($prefs['feature_sefurl'] === 'y') {
$sefurl = substr($full, strlen($tikiroot)) . '?' . http_build_query($_GET);
$sefurlTypeMap = $this->getSefurlTypeMap();
$smarty->loadPlugin('smarty_modifier_sefurl');
$sefurl = $tikiroot . smarty_modifier_sefurl($sefurl, $sefurlTypeMap[$_GET[0]]);
}
// entry doesn't match "or" sefurl feature is in use but that also doesn't match
if ($data['entry'] != $entry && $sefurl && $data['entry'] !== $sefurl) {
return null;
}
$registered = (array) json_decode($data['parameters'], true);
if (!$this->allPresent($registered, $parameters) || !$this->allPresent($parameters, $registered)) {
return null;
}
$this->db->query('UPDATE `tiki_auth_tokens` SET `hits` = `hits` - 1 WHERE `tokenId` = ? AND hits != -1', array($data['tokenId']));
// Process autologin of temporary users
if ($data['createUser'] == 'y') {
$userlib = TikiLib::lib('user');
$tempuser = $data['userPrefix'] . $userlib->autogenerate_login($data['tokenId'], 6);
$groups = json_decode($data['groups'], true);
$parameters = json_decode($data['parameters'], true);
if (!$userlib->user_exists($tempuser)) {
$randompass = $userlib->genPass();
$userlib->add_user($tempuser, $randompass, $data['email'], '', false, NULL, NULL, NULL, $groups);
}
$userlib->autologin_user($tempuser);
$url = basename($data['entry']);
if ($parameters) {
$query = '?' . http_build_query($parameters, '', '&');
$url .= $query;
}
include_once 'tiki-sefurl.php';
$url = filter_out_sefurl($url);
TikiLib::lib('access')->redirect($url);
die;
}
$this->ok = true;
return (array) json_decode($data['groups'], true);
}
示例6: action_list
function action_list($input)
{
global $prefs;
$unifiedsearchlib = TikiLib::lib('unifiedsearch');
$index = $unifiedsearchlib->getIndex();
$dataSource = $unifiedsearchlib->getDataSource();
$start = 'tracker_field_' . $input->beginField->word();
$end = 'tracker_field_' . $input->endField->word();
if ($resource = $input->resourceField->word()) {
$resource = 'tracker_field_' . $resource;
}
if ($coloring = $input->coloringField->word()) {
$coloring = 'tracker_field_' . $coloring;
}
$query = $unifiedsearchlib->buildQuery(array());
$query->filterRange($input->start->int(), $input->end->int(), array($start, $end));
$query->setRange(0, $prefs['unified_lucene_max_result']);
if ($body = $input->filters->none()) {
$builder = new Search_Query_WikiBuilder($query);
$builder->apply(WikiParser_PluginMatcher::match($body));
}
$result = $query->search($index);
$result = $dataSource->getInformation($result, array('title', $start, $end));
$response = array();
$fields = array();
if ($definition = Tracker_Definition::get($input->trackerId->int())) {
foreach ($definition->getPopupFields() as $fieldId) {
if ($field = $definition->getField($fieldId)) {
$fields[] = $field;
}
}
}
$smarty = TikiLib::lib('smarty');
$smarty->loadPlugin('smarty_modifier_sefurl');
$trklib = TikiLib::lib('trk');
foreach ($result as $row) {
$item = Tracker_Item::fromId($row['object_id']);
$description = '';
foreach ($fields as $field) {
if ($item->canViewField($field['fieldId'])) {
$val = trim($trklib->field_render_value(array('field' => $field, 'item' => $item->getData(), 'process' => 'y')));
if ($val) {
if (count($fields) > 1) {
$description .= "<h5>{$field['name']}</h5>";
}
$description .= $val;
}
}
}
$response[] = array('id' => $row['object_id'], 'trackerId' => isset($row['tracker_id']) ? $row['tracker_id'] : null, 'title' => $row['title'], 'description' => $description, 'url' => smarty_modifier_sefurl($row['object_id'], $row['object_type']), 'allDay' => false, 'start' => $this->getTimestamp($row[$start]), 'end' => $this->getTimestamp($row[$end]), 'editable' => $item->canModify(), 'color' => $this->getColor(isset($row[$coloring]) ? $row[$coloring] : ''), 'textColor' => '#000', 'resource' => $resource && isset($row[$resource]) ? strtolower($row[$resource]) : '');
}
return $response;
}
示例7: renderOutput
public function renderOutput($context = array())
{
if ($this->isLink($context)) {
$itemId = $this->getItemId();
$query = $_GET;
unset($query['trackerId']);
if (isset($query['page'])) {
$query['from'] = $query['page'];
unset($query['page']);
}
$classList = array('tablename');
$metadata = TikiLib::lib('object')->get_metadata('trackeritem', $itemId, $classList);
require_once 'lib/smarty_tiki/modifier.sefurl.php';
$href = smarty_modifier_sefurl($itemId, 'trackeritem');
$href .= strpos($href, '?') === false ? '?' : '&';
$href .= http_build_query($query, '', '&');
$arguments = array('class' => implode(' ', $classList), 'href' => $href);
if (!empty($context['url'])) {
if (strpos($context['url'], 'itemId') !== false) {
$context['url'] = preg_replace('/([&|\\?])itemId=?[^&]*/', '\\1itemId=' . $itemId, $context['url']);
} elseif (isset($context['reloff']) && strpos($context['url'], 'offset') !== false) {
global $smarty;
$context['url'] = preg_replace('/([&|\\?])tr_offset=?[^&]*/', '\\1tr_offset' . $smarty->tpl_vars['iTRACKERLIST'] . '=' . $context['reloff'], $context['url']);
}
$arguments['href'] = $context['url'];
}
$pre = '<a';
foreach ($arguments as $key => $value) {
$pre .= ' ' . $key . '="' . htmlentities($value, ENT_QUOTES, 'UTF-8') . '"';
}
if (isset($context['showpopup']) && $context['showpopup'] == 'y') {
$popup = $this->renderPopup();
if ($popup) {
$popup = preg_replace('/<\\!--.*?-->/', '', $popup);
// remove comments added by log_tpl
$popup = preg_replace('/\\s+/', ' ', $popup);
$pre .= " {$popup}";
}
}
$pre .= $metadata;
$pre .= '>';
$post = '</a>';
return $pre . $this->renderInnerOutput($context) . $post;
} else {
return $this->renderInnerOutput($context);
}
}
示例8: smarty_function_object_link_default
function smarty_function_object_link_default($smarty, $object, $title = null, $type = 'wiki page', $url = null)
{
global $base_url;
$smarty->loadPlugin('smarty_modifier_sefurl');
$smarty->loadPlugin('smarty_modifier_escape');
if (empty($title)) {
$title = TikiLib::lib('object')->get_title($type, $object);
}
if (empty($title) && $type == 'freetag') {
// Blank freetag should not be returned with "No title specified"
return '';
}
$escapedPage = smarty_modifier_escape($title ? $title : tra('No title specified'));
if ($url) {
$escapedHref = smarty_modifier_escape($url);
} else {
$escapedHref = smarty_modifier_escape(smarty_modifier_sefurl($object, $type));
}
$classList = array();
if ($type == "blog post") {
$classList[] = "link";
} elseif ($type == "freetag") {
$classList[] = 'freetag';
}
$metadata = TikiLib::lib('object')->get_metadata($type, $object, $classList);
$class = ' class="' . implode(' ', $classList) . '"';
$html = '<a href="' . $base_url . $escapedHref . '"' . $class . $metadata . '>' . $escapedPage . '</a>';
$attributelib = TikiLib::lib('attribute');
$attributes = $attributelib->get_attributes($type, $object);
global $prefs;
if (isset($attributes['tiki.content.source']) && $prefs['fgal_source_show_refresh'] == 'y') {
$smarty->loadPlugin('smarty_function_icon');
$smarty->loadPlugin('smarty_function_service');
$html .= '<a class="file-refresh" href="' . smarty_function_service(array('controller' => 'file', 'action' => 'refresh', 'fileId' => intval($object)), $smarty) . '">' . smarty_function_icon(array('_id' => 'arrow_refresh'), $smarty) . '</a>';
TikiLib::lib('header')->add_js('
$(".file-refresh").removeClass("file-refresh").click(function () {
$.getJSON($(this).attr("href"));
$(this).remove();
return false;
});');
}
return $html;
}
示例9: renderInnerOutput
public function renderInnerOutput($context = array())
{
$selected_categories = $this->getConfiguration('selected_categories');
$categories = $this->getConfiguration('list');
$ret = array();
foreach ($selected_categories as $categId) {
foreach ($categories as $category) {
if ($category['categId'] == $categId) {
if ($this->getOption('descendants') == 2) {
$str = $category['relativePathString'];
} else {
$str = $category['name'];
}
if (strpos($this->getOption('outputtype'), 'links') !== false) {
TikiLib::lib('smarty')->loadPlugin('smarty_modifier_sefurl');
$deep = $this->getOption('descendants') != 0;
$href = smarty_modifier_sefurl($categId, 'category', $deep, '', 'y', $str);
if ($deep) {
$href .= 'deep=on';
}
$str = "<a href=\"{$href}\">{$str}</a>";
}
$ret[] = $str;
break;
}
}
}
if (strpos($this->getOption('outputtype'), 'ul') === 0) {
if (count($ret)) {
$out = '<ul class="tracker_field_category">';
foreach ($ret as $li) {
$out .= '<li>' . $li . '</li>';
}
$out .= '</ul>';
return $out;
} else {
return '';
}
} else {
return implode('<br/>', $ret);
}
}
示例10: getItemList
private function getItemList($itemIds)
{
$trklib = TikiLib::lib('trk');
require_once 'lib/smarty_tiki/modifier.sefurl.php';
$out = array();
foreach ($itemIds as $itemId) {
$out[] = array('itemId' => $itemId, 'title' => $trklib->get_isMain_value(null, $itemId), 'localUrl' => smarty_modifier_sefurl($itemId, 'trackeritem'));
}
return $out;
}
示例11: _breadcrumb_getTitle
function _breadcrumb_getTitle($crumbs, $loc)
{
global $prefs, $print_page, $info, $structure, $structure_path, $tikilib, $smarty;
$len = count($crumbs);
if ($prefs['feature_breadcrumbs'] == 'n' || $prefs['feature_sitetitle'] == 'title') {
$smarty->loadPlugin('smarty_modifier_sefurl');
$smarty->loadPlugin('smarty_modifier_escape');
$class = "pagetitle";
$metadata = '';
$current = current_object();
$escapedHref = smarty_modifier_escape(smarty_modifier_sefurl($current['object'], $current['type']));
if ($coordinates = TikiLib::lib('geo')->get_coordinates($current['type'], $current['object'])) {
$class = ' geolocated primary';
$metadata = " data-geo-lat=\"{$coordinates['lat']}\" data-geo-lon=\"{$coordinates['lon']}\"";
if (isset($coordinates['zoom'])) {
$metadata .= " data-geo-zoom=\"{$coordinates['zoom']}\"";
}
}
$ret = '<strong><a class="' . $class . '"' . $metadata . ' title="' . tra("refresh") . '" href="' . $escapedHref . '">';
} else {
$class = "crumblink";
$ret = '<a class="' . $class . '" title="';
if ($structure == 'y' && $info) {
$cnt = count($structure_path);
} else {
$cnt = count($crumbs);
}
$ret .= tra("go back to this crumb");
$ret .= '" accesskey="' . $cnt;
include_once 'tiki-sefurl.php';
$ret .= '" href="' . filter_out_sefurl($crumbs[$len - 1]->url) . '">';
}
if ($prefs['feature_breadcrumbs'] == 'n' && $loc == "admin") {
$ret .= tra("Administration:") . " ";
}
if (!empty($prefs['wiki_pagename_strip'])) {
include_once 'lib/smarty_tiki/modifier.pagename.php';
$ret .= tra(smarty_modifier_pagename($crumbs[$len - 1]->title)) . '</a>';
} else {
$ret .= htmlentities(tra($crumbs[$len - 1]->title), ENT_QUOTES, 'UTF-8') . '</a>';
}
$ret .= help_doclink(array('crumb' => $crumbs[$len - 1]));
if (isset($info['flag']) && $info['flag'] == 'L' && $print_page != 'y') {
$ret .= ' <img src="img/icons/lock.png" height="16" width="16" alt="' . tra('locked') . '" title="' . tra('locked by') . ' ' . $info['user'] . '" />';
}
if ($prefs['feature_breadcrumbs'] == 'n' || $prefs['feature_sitetitle'] == 'title') {
$ret .= '</strong>';
}
return $ret;
}
示例12: getDocumentPart
function getDocumentPart(Search_Type_Factory_Interface $typeFactory)
{
if ($this->getOption('indexGeometry') && $this->getValue()) {
TikiLib::lib('smarty')->loadPlugin('smarty_modifier_sefurl');
$urls = array();
foreach (explode(',', $this->getValue()) as $value) {
$urls[] = smarty_modifier_sefurl($value, 'file');
}
return array('geo_located' => $typeFactory->identifier('y'), 'geo_file' => $typeFactory->identifier(implode(',', $urls)), 'geo_file_format' => $typeFactory->identifier($this->getOption('indexGeometry')));
} else {
return parent::getDocumentPart($typeFactory);
}
}
示例13: _breadcrumb_getTitle
function _breadcrumb_getTitle($crumbs, $loc)
{
global $prefs, $print_page, $info, $structure, $structure_path;
$smarty = TikiLib::lib('smarty');
$tikilib = TikiLib::lib('tiki');
$len = count($crumbs);
if ($prefs['feature_breadcrumbs'] == 'n' || $prefs['feature_sitetitle'] == 'title') {
$smarty->loadPlugin('smarty_modifier_sefurl');
$smarty->loadPlugin('smarty_modifier_escape');
$class = "";
$metadata = '';
$current = current_object();
$escapedHref = smarty_modifier_escape(smarty_modifier_sefurl($current['object'], $current['type']));
if ($coordinates = TikiLib::lib('geo')->get_coordinates($current['type'], $current['object'])) {
$class = ' geolocated primary';
$metadata = " data-geo-lat=\"{$coordinates['lat']}\" data-geo-lon=\"{$coordinates['lon']}\"";
if (isset($coordinates['zoom'])) {
$metadata .= " data-geo-zoom=\"{$coordinates['zoom']}\"";
}
}
$ret = '<a class="' . $class . '"' . $metadata . ' title="' . tra("refresh") . '" href="' . $escapedHref . '">';
} else {
$class = "crumblink";
$ret = '<a class="' . $class . '" title="';
if ($structure == 'y' && $info) {
$cnt = count($structure_path);
} else {
$cnt = count($crumbs);
}
$ret .= tra("go back to this crumb");
$ret .= '" accesskey="' . $cnt;
include_once 'tiki-sefurl.php';
$ret .= '" href="' . filter_out_sefurl($crumbs[$len - 1]->url) . '">';
}
if ($prefs['feature_breadcrumbs'] == 'n' && $loc == "admin") {
$ret .= tra("Administration:") . " ";
}
// Should show alias if in structure
$cur_title = $crumbs[$len - 1]->title;
if ($structure == 'y') {
foreach ($structure_path as $crumb) {
if ($crumb['pageName'] == $cur_title && $crumb['page_alias'] != '') {
$cur_title = $crumb['page_alias'];
}
}
}
if (!empty($prefs['wiki_pagename_strip'])) {
include_once 'lib/smarty_tiki/modifier.pagename.php';
$ret .= tra(smarty_modifier_pagename($cur_title)) . '</a>';
} else {
$ret .= htmlentities(tra($cur_title), ENT_QUOTES, 'UTF-8') . '</a>';
}
$ret .= help_doclink(array('crumb' => $crumbs[$len - 1]));
if (isset($info['flag']) && $info['flag'] == 'L' && $print_page != 'y') {
$smarty->loadPlugin('smarty_function_icon');
$ret .= smarty_function_icon(['name' => 'lock', 'iclass' => 'tips', 'ititle' => ':' . tra('Locked by') . $info['user']], $smarty);
}
return $ret;
}
示例14: generate_feed_from_data
function generate_feed_from_data($data, $feed_descriptor)
{
require_once 'lib/smarty_tiki/modifier.sefurl.php';
$tikilib = TikiLib::lib('tiki');
$writer = new Zend_Feed_Writer_Feed();
$writer->setTitle($feed_descriptor['feedTitle']);
$writer->setDescription($feed_descriptor['feedDescription']);
$writer->setLink($tikilib->tikiUrl(''));
$writer->setDateModified(time());
foreach ($data as $row) {
$titleKey = $feed_descriptor['entryTitleKey'];
$url = $row[$feed_descriptor['entryUrlKey']];
$title = $row[$titleKey];
if (isset($feed_descriptor['entryObjectDescriptors'])) {
list($typeKey, $objectKey) = $feed_descriptor['entryObjectDescriptors'];
$object = $row[$objectKey];
$type = $row[$typeKey];
if (empty($url)) {
$url = smarty_modifier_sefurl($object, $type);
}
if (empty($title)) {
$title = TikiLib::lib('object')->get_title($type, $object);
}
}
$entry = $writer->createEntry();
$entry->setTitle($title ? $title : tra('Unspecified'));
$entry->setLink($tikilib->tikiUrl($url));
$entry->setDateModified($row[$feed_descriptor['entryModificationKey']]);
$writer->addEntry($entry);
}
return $writer;
}
示例15: wikiplugin_img
//.........这里部分代码省略.........
$params['fgalId'] = '';
$repl .= wikiplugin_img($data, $params, $offset, $parseOptions);
}
if (strpos($repl, $notice) !== false) {
return $repl;
} else {
$repl = "\n\r" . '<br style="clear:both" />' . "\r" . $repl . "\n\r" . '<br style="clear:both" />' . "\r";
return $repl; // return the multiple images
}
}
$repl = '';
//////////////////////Set src for html///////////////////////////////
//Set variables for the base path for images in file galleries, image galleries and attachments
global $base_url;
$absolute_links = (!empty($parseOptions['absolute_links'])) ? $parseOptions['absolute_links'] : false;
$imagegalpath = ($absolute_links ? $base_url : '') . 'show_image.php?id=';
$filegalpath = ($absolute_links ? $base_url : '') . 'tiki-download_file.php?fileId=';
$attachpath = ($absolute_links ? $base_url : '') . 'tiki-download_wiki_attachment.php?attId=';
//get random image and treat as file gallery image afterwards
if (!empty($imgdata['randomGalleryId'])) {
$filegallib = TikiLib::lib('filegal');
$dbinfo = $filegallib->get_file(0, $imgdata['randomGalleryId']);
$imgdata['fileId'] = $dbinfo['fileId'];
$basepath = $prefs['fgal_use_dir'];
}
if (empty($imgdata['src'])) {
if (!empty($imgdata['id'])) {
$src = $imagegalpath . $imgdata['id'];
} elseif (!empty($imgdata['fileId'])) {
$smarty->loadPlugin('smarty_modifier_sefurl');
$src = smarty_modifier_sefurl($imgdata['fileId'], 'file');
if ($absolute_links) {
$src = TikiLib::tikiUrl($src);
}
} else { //only attachments left
$src = $attachpath . $imgdata['attId'];
}
} elseif ( (!empty($imgdata['src'])) && $absolute_links && ! preg_match('|^[a-zA-Z]+:\/\/|', $imgdata['src']) ) {
global $base_host, $url_path;
$src = $base_host.( $imgdata['src'][0] == '/' ? '' : $url_path ) . $imgdata['src'];
} elseif (!empty($imgdata['src']) && $tikidomain && !preg_match('|^https?:|', $imgdata['src'])) {
$src = preg_replace("~img/wiki_up/~", "img/wiki_up/$tikidomain/", $imgdata['src']);
} elseif (!empty($imgdata['src'])) {
$src = $imgdata['src'];
}
$browse_full_image = $src;
///////////////////////////Get DB info for image size and metadata/////////////////////////////
if (!empty($imgdata['height']) || !empty($imgdata['width']) || !empty($imgdata['max'])
|| !empty($imgdata['desc']) || strpos($imgdata['rel'], 'box') !== false
|| !empty($imgdata['stylebox']) || !empty($imgdata['styledesc']) || !empty($imgdata['button'])
|| !empty($imgdata['thumb']) || !empty($imgdata['align']) || !empty($imgdata['metadata']) || !empty($imgdata['fileId'])
) {
//Get ID numbers for images in galleries and attachments included in src as url parameter
//So we can get db info for these too
$parsed = parse_url($imgdata['src']);
if (empty($parsed['host']) || (!empty($parsed['host']) && strstr($base_url, $parsed['host']))) {
if (strlen(strstr($imgdata['src'], $imagegalpath)) > 0) {
$imgdata['id'] = substr(strstr($imgdata['src'], $imagegalpath), strlen($imagegalpath));
} elseif (strlen(strstr($imgdata['src'], $filegalpath)) > 0) {