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


PHP Tiki_Profile類代碼示例

本文整理匯總了PHP中Tiki_Profile的典型用法代碼示例。如果您正苦於以下問題:PHP Tiki_Profile類的具體用法?PHP Tiki_Profile怎麽用?PHP Tiki_Profile使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Tiki_Profile類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


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