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


PHP Component::add方法代码示例

本文整理汇总了PHP中Component::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::add方法的具体用法?PHP Component::add怎么用?PHP Component::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Component的用法示例。


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

示例1: add

 public function add(&$object)
 {
     if ($object instanceof Component) {
         $this->addComponent($object);
         return;
     }
     parent::add($object);
 }
开发者ID:picon,项目名称:picon-framework,代码行数:8,代码来源:MarkupContainer.php

示例2: getRelatedTagsResult

 /**
  * Answer tag cloud of related tags
  * 
  * @param Component $mainScreen
  * @return void
  * @access public
  * @since 4/8/08
  */
 public function getRelatedTagsResult(Component $mainScreen)
 {
     ob_start();
     print "<h3 style='margin-top: 0px; margin-bottom: 0px;'>" . _("Related Tags:") . "</h3>";
     $tag = $this->getTag();
     print TagAction::getTagCloudDiv($tag->getRelatedTags(TAG_SORT_FREQ), 'view', 100);
     $mainScreen->add(new Block(ob_get_clean(), STANDARD_BLOCK), "100%", null, LEFT, TOP);
 }
开发者ID:adamfranco,项目名称:segue,代码行数:16,代码来源:SegueAllTagAction.abstract.php

示例3: save

 public function save()
 {
     if (!isset($_SESSION['logged'])) {
         return call('pages', 'home');
     } else {
         $post_data = $_POST;
         Component::add($post_data);
         return call('components', 'index');
     }
 }
开发者ID:ScalateKids,项目名称:Scalatetrack,代码行数:10,代码来源:components_controller.php

示例4: addTo

 /**
  * Adds component to given parent component
  *
  * @param Component $parent
  *
  * @return $this
  */
 public function addTo(Component $parent)
 {
     $parent->add($this);
     $this->parent = $parent;
     return $this;
 }
开发者ID:jmversteeg,项目名称:fieldwork,代码行数:13,代码来源:Component.php

示例5: getResult

 /**
  * Parses the input data and returns a correct VFREEBUSY object, wrapped in
  * a VCALENDAR.
  *
  * @return Component
  */
 public function getResult()
 {
     $busyTimes = array();
     foreach ($this->objects as $object) {
         foreach ($object->getBaseComponents() as $component) {
             switch ($component->name) {
                 case 'VEVENT':
                     $FBTYPE = 'BUSY';
                     if (isset($component->TRANSP) && strtoupper($component->TRANSP) === 'TRANSPARENT') {
                         break;
                     }
                     if (isset($component->STATUS)) {
                         $status = strtoupper($component->STATUS);
                         if ($status === 'CANCELLED') {
                             break;
                         }
                         if ($status === 'TENTATIVE') {
                             $FBTYPE = 'BUSY-TENTATIVE';
                         }
                     }
                     $times = array();
                     if ($component->RRULE) {
                         $iterator = new RecurrenceIterator($object, (string) $component->uid);
                         if ($this->start) {
                             $iterator->fastForward($this->start);
                         }
                         $maxRecurrences = 200;
                         while ($iterator->valid() && --$maxRecurrences) {
                             $startTime = $iterator->getDTStart();
                             if ($this->end && $startTime > $this->end) {
                                 break;
                             }
                             $times[] = array($iterator->getDTStart(), $iterator->getDTEnd());
                             $iterator->next();
                         }
                     } else {
                         $startTime = $component->DTSTART->getDateTime();
                         if ($this->end && $startTime > $this->end) {
                             break;
                         }
                         $endTime = null;
                         if (isset($component->DTEND)) {
                             $endTime = $component->DTEND->getDateTime();
                         } elseif (isset($component->DURATION)) {
                             $duration = DateTimeParser::parseDuration((string) $component->DURATION);
                             $endTime = clone $startTime;
                             $endTime->add($duration);
                         } elseif ($component->DTSTART->getDateType() === Property\DateTime::DATE) {
                             $endTime = clone $startTime;
                             $endTime->modify('+1 day');
                         } else {
                             // The event had no duration (0 seconds)
                             break;
                         }
                         $times[] = array($startTime, $endTime);
                     }
                     foreach ($times as $time) {
                         if ($this->end && $time[0] > $this->end) {
                             break;
                         }
                         if ($this->start && $time[1] < $this->start) {
                             break;
                         }
                         $busyTimes[] = array($time[0], $time[1], $FBTYPE);
                     }
                     break;
                 case 'VFREEBUSY':
                     foreach ($component->FREEBUSY as $freebusy) {
                         $fbType = isset($freebusy['FBTYPE']) ? strtoupper($freebusy['FBTYPE']) : 'BUSY';
                         // Skipping intervals marked as 'free'
                         if ($fbType === 'FREE') {
                             continue;
                         }
                         $values = explode(',', $freebusy);
                         foreach ($values as $value) {
                             list($startTime, $endTime) = explode('/', $value);
                             $startTime = DateTimeParser::parseDateTime($startTime);
                             if (substr($endTime, 0, 1) === 'P' || substr($endTime, 0, 2) === '-P') {
                                 $duration = DateTimeParser::parseDuration($endTime);
                                 $endTime = clone $startTime;
                                 $endTime->add($duration);
                             } else {
                                 $endTime = DateTimeParser::parseDateTime($endTime);
                             }
                             if ($this->start && $this->start > $endTime) {
                                 continue;
                             }
                             if ($this->end && $this->end < $startTime) {
                                 continue;
                             }
                             $busyTimes[] = array($startTime, $endTime, $fbType);
                         }
                     }
                     break;
//.........这里部分代码省略.........
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:101,代码来源:FreeBusyGenerator.php

示例6: addSiteContent

 /**
  * Add the site content gui components
  * 
  * @param Component $mainScreen
  * @return void
  * @access public
  */
 public function addSiteContent(Component $mainScreen)
 {
     $harmoni = Harmoni::instance();
     if ($this->isAuthorizedToExecute()) {
         // :: Site ::
         $rootSiteComponent = SiteDispatcher::getCurrentRootNode();
         $this->siteGuiComponent = $rootSiteComponent->acceptVisitor($this->getSiteVisitor());
         $mainScreen->add($this->siteGuiComponent);
     } else {
         // Replace the title
         $outputHandler = $harmoni->getOutputHandler();
         $title = "\n\t\t<title>" . _("Unauthorized") . "</title>";
         $outputHandler->setHead(preg_replace("/<title>[^<]*<\\/title>/", $title, $outputHandler->getHead()));
         $mainScreen->add(new Block($this->getUnauthorizedMessage(), ALERT_BLOCK), "100%", null, CENTER, TOP);
     }
 }
开发者ID:adamfranco,项目名称:segue,代码行数:23,代码来源:html.act.php

示例7: testAnotherSerializeOrderProp

 function testAnotherSerializeOrderProp()
 {
     $prop4s = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10');
     $comp = new Component('VCARD');
     $comp->__set('SOMEPROP', 'FOO');
     $comp->__set('ANOTHERPROP', 'FOO');
     $comp->__set('THIRDPROP', 'FOO');
     foreach ($prop4s as $prop4) {
         $comp->add('PROP4', 'FOO ' . $prop4);
     }
     $comp->__set('PROPNUMBERFIVE', 'FOO');
     $comp->__set('PROPNUMBERSIX', 'FOO');
     $comp->__set('PROPNUMBERSEVEN', 'FOO');
     $comp->__set('PROPNUMBEREIGHT', 'FOO');
     $comp->__set('PROPNUMBERNINE', 'FOO');
     $comp->__set('PROPNUMBERTEN', 'FOO');
     $comp->__set('VERSION', '2.0');
     $comp->__set('UID', 'FOO');
     $str = $comp->serialize();
     $this->assertEquals("BEGIN:VCARD\r\nVERSION:2.0\r\nSOMEPROP:FOO\r\nANOTHERPROP:FOO\r\nTHIRDPROP:FOO\r\nPROP4:FOO 1\r\nPROP4:FOO 2\r\nPROP4:FOO 3\r\nPROP4:FOO 4\r\nPROP4:FOO 5\r\nPROP4:FOO 6\r\nPROP4:FOO 7\r\nPROP4:FOO 8\r\nPROP4:FOO 9\r\nPROP4:FOO 10\r\nPROPNUMBERFIVE:FOO\r\nPROPNUMBERSIX:FOO\r\nPROPNUMBERSEVEN:FOO\r\nPROPNUMBEREIGHT:FOO\r\nPROPNUMBERNINE:FOO\r\nPROPNUMBERTEN:FOO\r\nUID:FOO\r\nEND:VCARD\r\n", $str);
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:21,代码来源:ComponentTest.php

示例8: addFooterControls

 /**
  * Add the footer controls to the main screen gui component
  * 
  * @param object Component $mainScreen
  * @return void
  * @access public
  * @since 4/7/08
  */
 public function addFooterControls(Component $mainScreen)
 {
     // :: Footer ::
     $harmoni = Harmoni::instance();
     $rootSiteComponent = SiteDispatcher::getCurrentRootNode();
     $footer = $mainScreen->add(new Container(new XLayout(), BLANK, 1), $rootSiteComponent->getWidth(), null, CENTER, BOTTOM);
     ob_start();
     print "<div class='seguefooter_left'>";
     // Home
     print "<a href='" . $harmoni->request->quickURL('portal', 'list') . "' title='" . _("List of Segue sites") . "'>";
     print _("home") . "</a> | ";
     // Help LInk
     print Help::link();
     // Site Map
     $siteMapUrl = $harmoni->request->quickURL("view", "map", array('node' => SiteDispatcher::getCurrentNodeId()));
     print " | <a target='_blank' href='" . $siteMapUrl . "'";
     print ' onclick="';
     print "var url = '" . $siteMapUrl . "'; ";
     print "window.open(url, 'site_map', 'width=500,height=600,resizable=yes,scrollbars=yes'); ";
     print "return false;";
     print '"';
     print ">" . _("map") . "</a>";
     // Tracking
     $trackingUrl = $harmoni->request->quickURL("participation", "actions", array('node' => SiteDispatcher::getCurrentNodeId()));
     print " | <a target='_blank' href='" . $trackingUrl . "'";
     print ' onclick="';
     print "var url = '" . $trackingUrl . "'; ";
     print "window.open(url, 'site_map', 'width=500,height=600,resizable=yes,scrollbars=yes'); ";
     print "return false;";
     print '"';
     print ">" . _("track") . "</a>";
     print "</div>";
     $footer->add(new UnstyledBlock(ob_get_clean()), "50%", null, LEFT, BOTTOM);
     $footer->add(new UnstyledBlock(displayAction::getVersionText()), "50%", null, RIGHT, BOTTOM);
 }
开发者ID:adamfranco,项目名称:segue,代码行数:43,代码来源:html.act.php


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