本文整理汇总了PHP中Tiki_Profile类的典型用法代码示例。如果您正苦于以下问题:PHP Tiki_Profile类的具体用法?PHP Tiki_Profile怎么用?PHP Tiki_Profile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tiki_Profile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_parsed_template
function get_parsed_template($templateId, $lang = null, $format = 'yaml')
{
$res = $this->get_template($templateId, $lang);
if (!$res) {
return false;
}
switch ($format) {
case 'yaml':
require_once 'lib/profilelib/profilelib.php';
require_once 'lib/profilelib/installlib.php';
$content = "{CODE(caption=>YAML)}objects:\n" . " -\n" . " type: file_gallery\n" . " data:\n" . " " . implode("\n ", explode("\n", $res['content'])) . "{CODE}";
$profile = Tiki_Profile::fromString($content, $res['name']);
$installer = new Tiki_Profile_Installer();
$objects = $profile->getObjects();
if (isset($objects[0])) {
$data = $installer->getInstallHandler($objects[0])->getData();
unset($data['galleryId'], $data['parentId'], $data['name'], $data['user']);
$res['content'] = $data;
} else {
$res['content'] = array();
}
break;
}
return $res;
}
开发者ID:railfuture,项目名称:tiki-website,代码行数:25,代码来源:templateslib.php
示例2: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$profileName = $input->getArgument('profile');
$repository = $input->getArgument('repository');
$force = $input->getOption('force');
$profile = \Tiki_Profile::fromNames($repository, $profileName);
if (!$profile) {
$output->writeln('<error>Profile not found.</error>');
return;
}
$tikilib = \TikiLib::lib('tiki');
$installer = new \Tiki_Profile_Installer();
$isInstalled = $installer->isInstalled($profile);
if ($isInstalled && $force) {
$installer->forget($profile);
$isInstalled = false;
}
if (!$isInstalled) {
$transaction = $tikilib->begin();
if ($installer->install($profile)) {
$transaction->commit();
$output->writeln('Profile applied.');
} else {
$output->writeln("<error>Installation failed:</error>");
foreach ($installer->getFeedback() as $error) {
$output->writeln("<error>{$error}</error>");
}
}
} else {
$output->writeln('<info>Profile was already applied. Nothing happened.</info>');
}
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:32,代码来源:ProfileInstallCommand.php
示例3: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$data = $this->obj->getData();
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:jkimdon,项目名称:cohomeals,代码行数:9,代码来源:ArticleTopic.php
示例4: testGetObjects
function testGetObjects()
{
$builder = new Services_Workspace_ProfileBuilder();
$builder->addObject('wiki_page', 'foo', array('name' => 'Foo', 'namespace' => $builder->user('namespace'), 'content' => 'Hello', 'categories' => $builder->user('category')));
$builder->addObject('wiki_page', 'bar', array('name' => 'Bar', 'namespace' => $builder->user('namespace'), 'content' => 'World', 'categories' => $builder->user('category')));
$profile = Tiki_Profile::fromString($builder->getContent());
$analyser = new Services_Workspace_ProfileAnalyser($profile);
$this->assertEquals(array(array('name' => 'Foo', 'namespace' => '{namespace}', 'content' => 'Hello'), array('name' => 'Bar', 'namespace' => '{namespace}', 'content' => 'World')), $analyser->getObjects('wiki_page'));
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:9,代码来源:AnalyserTest.php
示例5: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$defaults = array('sections' => array('wiki'), 'type' => 'static');
$data = array_merge($defaults, $this->obj->getData());
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:10,代码来源:Template.php
示例6: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$defaults = array('description' => '', 'user' => 'admin', 'public' => 'n', 'max_posts' => 10, 'heading' => '', 'post_heading' => '', 'use_find' => 'y', 'comments' => 'n', 'show_avatar' => 'n');
$data = array_merge($defaults, $this->obj->getData());
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:10,代码来源:Blog.php
示例7: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$defaults = array('title' => 'Title', 'private' => 'n', 'user' => '', 'geolocation' => '');
$data = array_merge($defaults, $this->obj->getData());
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:10,代码来源:BlogPost.php
示例8: getData
private function getData()
{
if ($this->data) {
return $this->data;
}
$data = $this->obj->getData();
$data = Tiki_Profile::convertLists($data, array('show' => 'y', 'allow' => 'y'), true);
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:10,代码来源:Tracker.php
示例9: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$defaults = array();
$data = array_merge($defaults, $this->obj->getData());
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:10,代码来源:AreaBinding.php
示例10: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$defaults = array('preferences' => array());
$data = array_merge($defaults, $this->obj->getData());
$data['preferences'] = Tiki_Profile::convertLists($data['preferences'], array('enable' => 'y', 'disable' => 'n'));
$data['preferences'] = Tiki_Profile::convertYesNo($data['preferences']);
return $this->data = $data;
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:11,代码来源:Perspective.php
示例11: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$defaults = array('cache' => 0, 'rows' => 10, 'custom' => null, 'groups' => array(), 'params' => array(), 'parse' => null);
$data = array_merge($defaults, $this->obj->getData());
$data = Tiki_Profile::convertYesNo($data);
$data['params'] = Tiki_Profile::convertYesNo($data['params']);
return $this->data = $data;
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:11,代码来源:Module.php
示例12: getProfiles
function getProfiles(array $channelNames)
{
$profiles = array();
foreach ($channelNames as $channelName) {
$info = $this->channels[$channelName];
if ($profile = Tiki_Profile::fromNames($info['domain'], $info['profile'])) {
$profiles[$channelName] = $profile;
}
}
return $profiles;
}
开发者ID:railfuture,项目名称:tiki-website,代码行数:11,代码来源:channellib.php
示例13: serializeNamedObject
public static function serializeNamedObject($object)
{
if (strpos($object['domain'], '://') === false) {
if (is_dir($object['domain'])) {
$object['domain'] = "file://" . $object['domain'];
} else {
$object['domain'] = "http://" . $object['domain'];
}
}
return sprintf("%s#%s", Tiki_Profile::getProfileKeyfor($object['domain'], $object['profile']), $object['object']);
}
开发者ID:jkimdon,项目名称:cohomeals,代码行数:11,代码来源:Object.php
示例14: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$data = $this->obj->getData();
$data = Tiki_Profile::convertLists($data, array('show' => 'y'), true);
$defaults = array('description' => null, 'refresh' => 30, 'show_title' => 'n', 'show_publication_date' => 'n', 'article_generator' => null);
$data = array_merge($defaults, $data);
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:12,代码来源:Rss.php
示例15: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$addon_utilities = new \TikiAddons_Utilities();
$addonName = $input->getArgument('addon');
if (strpos($addonName, '/') !== false && strpos($addonName, '_') === false) {
$package = $addonName;
$folder = str_replace('/', '_', $addonName);
} else {
$package = str_replace('_', '/', $addonName);
$folder = $addonName;
}
$repository = 'file://addons/' . $folder . '/profiles';
$reapply = $input->getOption('reapply');
$ignoredepends = $input->getOption('ignoredepends');
if (empty(glob(TIKI_PATH . '/addons/' . $folder . '/profiles/*.yml'))) {
$output->writeln("<error>No profiles found.</error>");
return false;
}
if (!$ignoredepends) {
$addon_utilities->checkDependencies($folder);
}
$addons = \TikiAddons::getInstalled();
$tikilib = \TikiLib::lib('tiki');
$installer = new \Tiki_Profile_Installer();
foreach (glob(TIKI_PATH . '/addons/' . $folder . '/profiles/*.yml') as $file) {
$profileName = str_replace('.yml', '', basename($file));
$profile = \Tiki_Profile::fromNames($repository, $profileName);
if (!$profile) {
$output->writeln("<error>Profile {$profileName} not found.</error>");
continue;
}
$isInstalled = $installer->isInstalled($profile);
if ($isInstalled && $reapply) {
$installer->forget($profile);
$isInstalled = false;
}
if (!$isInstalled) {
$transaction = $tikilib->begin();
if ($installer->install($profile)) {
$addon_utilities->updateProfile($folder, $addons[$package]->version, $profileName);
$transaction->commit();
$output->writeln("Profile {$profileName} applied.");
} else {
$output->writeln("<error>Profile {$profileName} installation failed:</error>");
foreach ($installer->getFeedback() as $error) {
$output->writeln("<error>{$error}</error>");
}
}
} else {
$output->writeln("<info>Profile {$profileName} was already applied. Nothing happened.</info>");
}
}
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:53,代码来源:AddonInstallCommand.php
示例16: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$data = $this->obj->getData();
$defaults = array('description' => '', 'flood_interval' => 120, 'moderator' => 'admin', 'per_page' => 10, 'prune_max_age' => 3 * 24 * 3600, 'prune_unreplied_max_age' => 30 * 24 * 3600, 'topic_order' => 'lastPost_desc', 'thread_order' => '', 'section' => '', 'inbound_pop_server' => '', 'inbound_pop_port' => 110, 'inbound_pop_user' => '', 'inbound_pop_password' => '', 'outbound_address' => '', 'outbound_from' => '', 'approval_type' => 'all_posted', 'moderator_group' => '', 'forum_password' => '', 'attachments' => 'none', 'attachments_store' => 'db', 'attachments_store_dir' => '', 'attachments_max_size' => 10000000, 'forum_last_n' => 0, 'comments_per_page' => '', 'thread_style' => '', 'is_flat' => 'n', 'list_topic_reads' => 'n', 'list_topic_replies' => 'n', 'list_topic_points' => 'n', 'list_topic_last_post' => 'n', 'list_topic_last_post_title' => 'n', 'list_topic_last_post_avatar' => 'n', 'list_topic_author' => 'n', 'list_topic_author_avatar' => 'n', 'show_description' => 'n', 'enable_flood_control' => 'n', 'enable_inbound_mail' => 'n', 'enable_prune_unreplied' => 'n', 'enable_prune_old' => 'n', 'enable_vote_threads' => 'n', 'enable_outbound_for_inbound' => 'n', 'enable_outbound_reply_link' => 'n', 'enable_topic_smiley' => 'n', 'enable_topic_summary' => 'n', 'enable_ui_avatar' => 'n', 'enable_ui_rating_choice_topic' => 'n', 'enable_ui_flag' => 'n', 'enable_ui_posts' => 'n', 'enable_ui_level' => 'n', 'enable_ui_email' => 'n', 'enable_ui_online' => 'n', 'enable_password_protection' => 'n', 'forum_language' => '');
$data = Tiki_Profile::convertLists($data, array('enable' => 'y', 'list' => 'y', 'show' => 'y'), true);
$data = array_merge($defaults, $data);
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:12,代码来源:Forum.php
示例17: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$data = $this->obj->getData();
$data = Tiki_Profile::convertLists($data, array('show' => 'y', 'allow' => 'y'), true);
$defaults = array('show_pre_publication' => 'n', 'show_post_expire' => 'n', 'show_heading_only' => 'n', 'show_image' => 'n', 'show_avatar' => 'n', 'show_author' => 'n', 'show_publication_date' => 'n', 'show_expiration_date' => 'n', 'show_reads' => 'n', 'show_size' => 'n', 'show_topline' => 'n', 'show_subtitle' => 'n', 'show_link_to' => 'n', 'show_image_caption' => 'n', 'allow_ratings' => 'n', 'allow_comments' => 'n', 'allow_comments_rating_article' => 'n', 'allow_creator_edit' => 'n');
$data = array_merge($defaults, $data);
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:12,代码来源:ArticleType.php
示例18: wikiplugin_profile
function wikiplugin_profile( $data, $params )
{
require_once 'lib/profilelib/profilelib.php';
require_once 'lib/profilelib/installlib.php';
global $tiki_p_admin;
if ( $tiki_p_admin != 'y' ) {
return '__' . tra('Profile plugin only available to administrators') . '__';
}
$params = array_merge(array('domain' => 'profiles.tiki.org'), $params);
if ( !isset( $params['name'] ) ) {
return 'Missing parameter __name__';
}
$profile = Tiki_Profile::fromNames($params['domain'], $params['name']);
if ( $profile ) {
$installer = new Tiki_Profile_Installer;
try {
if ( $installer->isInstalled($profile) ) {
if ( $_POST['reinstall'] == "{$params['domain']}/{$params['name']}" ) {
$installer->forget($profile);
$installer->install($profile);
header('Location: ' . $_SERVER['REQUEST_URI']);
exit;
}
} else {
if ( $_POST['install'] == "{$params['domain']}/{$params['name']}" ) {
$installer->install($profile);
header('Location: ' . $_SERVER['REQUEST_URI']);
exit;
}
}
} catch( Exception $e ) {
return '__' . $e->getMessage() . '__';
}
global $smarty;
$smarty->assign('profile_is_installed', $installer->isInstalled($profile));
$smarty->assign('profile_key', "{$params['domain']}/{$params['name']}");
return '~np~' . $smarty->fetch('wiki-plugins/wikiplugin_profile.tpl') . '~/np~';
} else {
return '__' . tr('Profile %0/%1 not found', $params['domain'], $params['name']) . '__';
}
}
开发者ID:railfuture,项目名称:tiki-website,代码行数:51,代码来源:wikiplugin_profile.php
示例19: getData
function getData()
{
if ($this->data) {
return $this->data;
}
$defaults = array('preserve' => 'n', 'guards' => array());
$data = array_merge($defaults, $this->obj->getData());
foreach ($data['guards'] as &$guard) {
if (is_string($guard[2])) {
$guard[2] = reset(Horde_Yaml::load("- " . $guard[2]));
}
}
$data = Tiki_Profile::convertYesNo($data);
return $this->data = $data;
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:15,代码来源:Transition.php
示例20: wikiplugin_datachannel
function wikiplugin_datachannel($data, $params)
{
static $execution = 0;
global $prefs, $smarty;
$executionId = 'datachannel-exec-' . ++$execution;
$fields = array();
$lines = explode("\n", $data);
$lines = array_map('trim', $lines);
$lines = array_filter($lines);
foreach ($lines as $line) {
$parts = explode(',', $line, 2);
if (count($parts) == 2) {
$fields[$parts[0]] = $parts[1];
}
}
require_once 'lib/profilelib/profilelib.php';
require_once 'lib/profilelib/channellib.php';
require_once 'lib/profilelib/installlib.php';
$groups = Perms::get()->getGroups();
$config = Tiki_Profile_ChannelList::fromConfiguration($prefs['profile_channels']);
if ($config->canExecuteChannels(array($params['channel']), $groups)) {
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['datachannel_execution']) && $_POST['datachannel_execution'] == $executionId) {
$input = array_intersect_key($_POST, $fields);
$static = $params;
unset($static['channel']);
$userInput = array_merge($input, $static);
Tiki_Profile::useUnicityPrefix(uniqid());
$installer = new Tiki_Profile_Installer();
$installer->limitGlobalPreferences(array());
$profiles = $config->getProfiles(array($params['channel']));
$profile = reset($profiles);
$installer->setUserData($userInput);
$installer->install($profile);
header('Location: ' . $_SERVER['REQUEST_URI']);
} else {
$smarty->assign('datachannel_fields', $fields);
$smarty->assign('datachannel_execution', $executionId);
return '~np~' . $smarty->fetch('wiki-plugins/wikiplugin_datachannel.tpl') . '~/np~';
}
}
}
开发者ID:rodin,项目名称:mcskb,代码行数:41,代码来源:wikiplugin_datachannel.php
注:本文中的Tiki_Profile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论