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


PHP self::setTitle方法代码示例

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


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

示例1: createFromTest

 /**
  * Import relevant properties from given test
  *
  * @param ilObjTest $a_test
  * @return object
  */
 public static function createFromTest(ilObjTest $a_test, $a_user_id)
 {
     global $lng;
     $lng->loadLanguageModule("wsp");
     $newObj = new self();
     $newObj->setTitle($lng->txt("wsp_type_tstv") . " \"" . $a_test->getTitle() . "\"");
     $newObj->setDescription($a_test->getDescription());
     $active_id = $a_test->getActiveIdOfUser($a_user_id);
     $pass = ilObjTest::_getResultPass($active_id);
     $date = $a_test->getPassFinishDate($active_id, $pass);
     $newObj->setProperty("issued_on", new ilDate($date, IL_CAL_UNIX));
     // create certificate
     include_once "Services/Certificate/classes/class.ilCertificate.php";
     include_once "Modules/Test/classes/class.ilTestCertificateAdapter.php";
     $certificate = new ilCertificate(new ilTestCertificateAdapter($a_test));
     $certificate = $certificate->outCertificate(array("active_id" => $active_id, "pass" => $pass), false);
     // save pdf file
     if ($certificate) {
         // we need the object id for storing the certificate file
         $newObj->create();
         $path = self::initStorage($newObj->getId(), "certificate");
         $file_name = "tst_" . $a_test->getId() . "_" . $a_user_id . "_" . $active_id . ".pdf";
         if (file_put_contents($path . $file_name, $certificate)) {
             $newObj->setProperty("file", $file_name);
             $newObj->update();
             return $newObj;
         }
         // file creation failed, so remove to object, too
         $newObj->delete();
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:37,代码来源:class.ilObjTestVerification.php

示例2: parseFromCdbXml

 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement $xmlElement)
  * @return self
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     if (empty($xmlElement->title)) {
         throw new CultureFeed_Cdb_ParseException("Title missing for actordetail element");
     }
     $attributes = $xmlElement->attributes();
     if (empty($attributes['lang'])) {
         throw new CultureFeed_Cdb_ParseException("Lang missing for actordetail element");
     }
     $actorDetail = new self();
     $actorDetail->setTitle((string) $xmlElement->title);
     $actorDetail->setLanguage((string) $attributes['lang']);
     if (!empty($xmlElement->calendarsummary)) {
         $actorDetail->setCalendarSummary((string) $xmlElement->calendarsummary);
     }
     if (!empty($xmlElement->shortdescription)) {
         $actorDetail->setShortDescription((string) $xmlElement->shortdescription);
     }
     if (!empty($xmlElement->longdescription)) {
         $actorDetail->setLongDescription((string) $xmlElement->longdescription);
     }
     if (!empty($xmlElement->media->file)) {
         foreach ($xmlElement->media->file as $fileElement) {
             $actorDetail->media->add(CultureFeed_Cdb_Data_File::parseFromCdbXML($fileElement));
         }
     }
     return $actorDetail;
 }
开发者ID:RustiSub,项目名称:Cdb,代码行数:32,代码来源:ActorDetail.php

示例3: createFromExercise

 /**
  * Import relevant properties from given exercise
  *
  * @param ilObjExercise $a_test
  * @return object
  */
 public static function createFromExercise(ilObjExercise $a_exercise, $a_user_id)
 {
     global $lng;
     $lng->loadLanguageModule("exercise");
     $newObj = new self();
     $newObj->setTitle($a_exercise->getTitle());
     $newObj->setDescription($a_exercise->getDescription());
     include_once "Services/Tracking/classes/class.ilLPMarks.php";
     $lp_marks = new ilLPMarks($a_exercise->getId(), $a_user_id);
     $newObj->setProperty("issued_on", new ilDate($lp_marks->getStatusChanged(), IL_CAL_DATETIME));
     // create certificate
     include_once "Services/Certificate/classes/class.ilCertificate.php";
     include_once "Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
     $certificate = new ilCertificate(new ilExerciseCertificateAdapter($a_exercise));
     $certificate = $certificate->outCertificate(array("user_id" => $a_user_id), false);
     // save pdf file
     if ($certificate) {
         // we need the object id for storing the certificate file
         $newObj->create();
         $path = self::initStorage($newObj->getId(), "certificate");
         $file_name = "exc_" . $a_exercise->getId() . "_" . $a_user_id . ".pdf";
         if (file_put_contents($path . $file_name, $certificate)) {
             $newObj->setProperty("file", $file_name);
             $newObj->update();
             return $newObj;
         }
         // file creation failed, so remove to object, too
         $newObj->delete();
     }
     // remove if certificate works
     $newObj->create();
     return $newObj;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:39,代码来源:class.ilObjExerciseVerification.php

示例4: withAttributes

 public static function withAttributes($title, $value, $isShort = true)
 {
     $instance = new self();
     $instance->setTitle($title);
     $instance->setValue($value);
     $instance->setShort($isShort);
     return $instance;
 }
开发者ID:digitalicagroup,项目名称:slack-hook-framework,代码行数:8,代码来源:SlackResultAttachmentField.php

示例5: box

 /**
  * Message box
  *
  * @param   Window  $parent
  * @param   string  $text
  * @param   string  $title
  * @return void
  */
 public static function box(Window $parent, $text, $title)
 {
     $msg = new self($parent);
     $msg->setText($text);
     $msg->setTitle($title);
     $msg->start();
     unset($msg);
 }
开发者ID:jean-pasqualini,项目名称:ia,代码行数:16,代码来源:Message.php

示例6: factory

 public static function factory($label, $link, array $params = array('icon' => 'tool-blue'))
 {
     $button = new self();
     $button->setTitle($label);
     $button->setLink($link);
     $button->setDecoratorParams($params);
     return $button;
 }
开发者ID:crapougnax,项目名称:t41,代码行数:8,代码来源:ButtonElement.php

示例7: create

 /**
  * Create a window
  */
 public static function create($title, $width, $height)
 {
     $inst = new self();
     $inst->setIsWrapped(TRUE);
     $inst->setTitle($title);
     $inst->setSize($width, $height);
     unset($inst->wrapper->{'widget'});
     return $inst;
 }
开发者ID:kiibe,项目名称:linkERP,代码行数:12,代码来源:TWindow.php

示例8: addNode

 /**
  * Add navigation node as a child
  * @staticvar int $counter
  * @param string $label
  * @param string $url
  * @param string $title
  * @return Node
  */
 public function addNode($label, $url, $title = NULL)
 {
     $node = new self();
     $node->setLabel($label);
     $node->setUrl($url);
     $node->setTitle($title);
     static $counter;
     $this->addComponent($node, ++$counter);
     return $node;
 }
开发者ID:jirinapravnik,项目名称:navigation,代码行数:18,代码来源:Node.php

示例9: createPage

 /**
  * @param string      $title
  * @param string      $urn
  * @param string|null $theme
  * @param string|null $layout
  *
  * @return Node
  */
 public static function createPage($title, $urn, $theme = null, $layout = null)
 {
     $page = new self();
     $page->setType(self::TYPE_PAGE);
     $page->setTitle($title);
     $page->setUrn($urn);
     $page->setTheme($theme);
     $page->setLayout($layout);
     return $page;
 }
开发者ID:jarves,项目名称:jarves,代码行数:18,代码来源:Node.php

示例10: buildComplete

 /**
  * @param $isbn10
  * @param $isbn13
  * @param $title
  * @param $authors
  * @param $publisher
  * @param $description
  * @param $pageCount
  * @param $imageLink
  *
  * @return Book
  */
 public static function buildComplete($isbn10, $isbn13, $title, $authors, $publisher, $description, $pageCount, $imageLink)
 {
     $instance = new self();
     $instance->setIsbn10($isbn10);
     $instance->setIsbn13($isbn13);
     $instance->setTitle($title);
     $instance->setAuthors($authors);
     $instance->setPublisher($publisher);
     $instance->setDescription($description);
     $instance->setPageCount($pageCount);
     $instance->setImageLink($imageLink);
     return $instance;
 }
开发者ID:sbernal93,项目名称:queryBooks,代码行数:25,代码来源:Book.php

示例11: fromFile

 /**
  * Read from a file
  *
  * @deprecated  Use img.io.MetaDataReader instead
  * @param   io.File file
  * @param   var default default void what should be returned in case no data is found
  * @return  img.util.IptcData
  * @throws  lang.FormatException in case malformed meta data is encountered
  * @throws  lang.ElementNotFoundException in case no meta data is available
  * @throws  img.ImagingException in case reading meta data fails
  */
 public static function fromFile(File $file)
 {
     if (FALSE === getimagesize($file->getURI(), $info)) {
         $e = new ImagingException('Cannot read image information from ' . $file->getURI());
         xp::gc(__FILE__);
         throw $e;
     }
     if (!isset($info['APP13'])) {
         if (func_num_args() > 1) {
             return func_get_arg(1);
         }
         throw new ElementNotFoundException('Cannot get IPTC information from ' . $file->getURI() . ' (no APP13 marker)');
     }
     if (!($iptc = iptcparse($info['APP13']))) {
         throw new FormatException('Cannot parse IPTC information from ' . $file->getURI());
     }
     // Parse creation date
     if (3 == sscanf(@$iptc['2#055'][0], '%4d%2d%d', $year, $month, $day)) {
         $created = Date::create($year, $month, $day, 0, 0, 0);
     } else {
         $created = NULL;
     }
     with($i = new self());
     $i->setTitle(@$iptc['2#005'][0]);
     $i->setUrgency(@$iptc['2#010'][0]);
     $i->setCategory(@$iptc['2#015'][0]);
     $i->setSupplementalCategories(@$iptc['2#020']);
     $i->setKeywords(@$iptc['2#025']);
     $i->setSpecialInstructions(@$iptc['2#040'][0]);
     $i->setDateCreated($created);
     $i->setAuthor(@$iptc['2#080'][0]);
     $i->setAuthorPosition(@$iptc['2#085'][0]);
     $i->setCity(@$iptc['2#090'][0]);
     $i->setState(@$iptc['2#095'][0]);
     $i->setCountry(@$iptc['2#101'][0]);
     $i->setOriginalTransmissionReference(@$iptc['2#103'][0]);
     $i->setHeadline(@$iptc['2#105'][0]);
     $i->setCredit(@$iptc['2#110'][0]);
     $i->setSource(@$iptc['2#115'][0]);
     $i->setCopyrightNotice(@$iptc['2#116'][0]);
     $i->setCaption(@$iptc['2#120'][0]);
     $i->setWriter(@$iptc['2#122'][0]);
     return $i;
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:55,代码来源:IptcData.class.php

示例12: createFromArray

 /**
  * @param Campaign $campaign
  * @param array $array
  * @return Campaign|Content
  */
 public static function createFromArray(Campaign $campaign = null, array $array = array())
 {
     $defaults = array("view_count" => 0, "like_count" => 0, "dislike_count" => 0, "favorite_count" => 0, "comment_count" => 0, "tw_share_count" => 0, "fb_share_count" => 0);
     $array = array_merge($defaults, $array);
     $content = new self($array['id'], $campaign);
     $content->setSource($array['source']);
     $content->setFoundAt(new \DateTime($array['found_at']));
     $content->setNativeId($array['native_id']);
     $content->setCreatedAt(new \DateTime($array['created_at']));
     $content->setUrl($array['url']);
     $content->setThumb($array['thumb']);
     $content->setVideoSrc($array['video_src']);
     $content->setTitle($array['title']);
     $content->setDescription($array['description']);
     $content->setVideoLength($array['video_length']);
     $content->setUsername($array['username']);
     $content->setViewCount($array['view_count']);
     $content->setLikeCount($array['like_count']);
     $content->setDislikeCount($array['dislike_count']);
     $content->setFavCount($array['favorite_count']);
     $content->setCommentCount($array['comment_count']);
     $content->setTwCount($array['tw_share_count']);
     $content->setFbCount($array['fb_share_count']);
     $content->setProcessed($array['processed']);
     if ($array['processed']) {
         $content->setProcessedAt(new \DateTime($array['processed_at']));
     }
     $content->setKeyword($array['keyword']);
     $content->setUserNativeId($array['user_native_id']);
     if (isset($array['popularity'])) {
         $content->setPopularity($array['popularity']);
     }
     if (isset($array['sr_status'])) {
         $content->setSrStatus($array['sr_status']);
     } else {
         if (isset($array['srstatus'])) {
             $content->setSrStatus($array['srstatus']);
         }
     }
     if (isset($array['followers'])) {
         $content->setUserReach($array['followers']);
     }
     return $content;
 }
开发者ID:sparkreel,项目名称:cesdk,代码行数:49,代码来源:Content.php

示例13: instanceFromAssocArray

 /**
  * @param array $arr
  * @return RiakBlogPost|null
  */
 public static function instanceFromAssocArray($arr)
 {
     if ($arr !== null) {
         $instance = new self();
         $instance->identifier = $arr[static::$IDENTIFIER_NAME];
         $instance->setAuthorIdentifier($arr[static::$AUTHOR_ID_NAME]);
         $instance->setAuthorDisplayName($arr[static::$AUTHOR_DISP_NAME]);
         $instance->postedDate = Carbon::createFromFormat(\DateTime::ISO8601, $arr[static::$POST_DATE_NAME]);
         $instance->lastModifiedDate = Carbon::createFromFormat(\DateTime::ISO8601, $arr[static::$MODIFIED_DATE_NAME]);
         $instance->setTitle(isset($arr[static::$TITLE_NAME]) ? $arr[static::$TITLE_NAME] : "");
         $instance->setContent($arr[static::$CONTENT_NAME]);
         if ($arr[static::$PUBLISHED_NAME] == '1') {
             $instance->setIsPublished(true);
         } else {
             $instance->setIsPublished(false);
         }
         return $instance;
     }
 }
开发者ID:KasparBP,项目名称:blogger,代码行数:23,代码来源:RiakBlogPost.php

示例14: createFromSCORMLM

 /**
  * Import relevant properties from given learning module
  *
  * @param ilObjSAHSLearningModule $a_lm
  * @return object
  */
 public static function createFromSCORMLM(ilObjSAHSLearningModule $a_lm, $a_user_id)
 {
     global $lng;
     $lng->loadLanguageModule("sahs");
     $newObj = new self();
     $newObj->setTitle($a_lm->getTitle());
     $newObj->setDescription($a_lm->getDescription());
     include_once "Services/Tracking/classes/class.ilLPMarks.php";
     $lp_marks = new ilLPMarks($a_lm->getId(), $a_user_id);
     $newObj->setProperty("issued_on", new ilDate($lp_marks->getStatusChanged(), IL_CAL_DATETIME));
     // create certificate
     if (!stristr(get_class($a_lm), "2004")) {
         $last_access = ilObjSCORMLearningModule::_lookupLastAccess($a_lm->getId(), $a_user_id);
     } else {
         $last_access = ilObjSCORM2004LearningModule::_lookupLastAccess($a_lm->getId(), $a_user_id);
     }
     $params = array("user_data" => ilObjUser::_lookupFields($a_user_id), "last_access" => $last_access);
     include_once "Services/Certificate/classes/class.ilCertificate.php";
     include_once "Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
     $certificate = new ilCertificate(new ilSCORMCertificateAdapter($a_lm));
     $certificate = $certificate->outCertificate($params, false);
     // save pdf file
     if ($certificate) {
         // we need the object id for storing the certificate file
         $newObj->create();
         $path = self::initStorage($newObj->getId(), "certificate");
         $file_name = "sahs_" . $a_lm->getId() . "_" . $a_user_id . ".pdf";
         if (file_put_contents($path . $file_name, $certificate)) {
             $newObj->setProperty("file", $file_name);
             $newObj->update();
             return $newObj;
         }
         // file creation failed, so remove to object, too
         $newObj->delete();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:42,代码来源:class.ilObjSCORMVerification.php

示例15: newExtraneousContext

 /**
  * Create a new extraneous context. The context is filled with information
  * external to the current session.
  * - Title is specified by argument
  * - Request is a FauxRequest, or a FauxRequest can be specified by argument
  * - User is an anonymous user, for separation IPv4 localhost is used
  * - Language will be based on the anonymous user and request, may be content
  *   language or a uselang param in the fauxrequest data may change the lang
  * - Skin will be based on the anonymous user, should be the wiki's default skin
  *
  * @param Title $title Title to use for the extraneous request
  * @param WebRequest|array $request A WebRequest or data to use for a FauxRequest
  * @return RequestContext
  */
 public static function newExtraneousContext(Title $title, $request = [])
 {
     $context = new self();
     $context->setTitle($title);
     if ($request instanceof WebRequest) {
         $context->setRequest($request);
     } else {
         $context->setRequest(new FauxRequest($request));
     }
     $context->user = User::newFromName('127.0.0.1', false);
     return $context;
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:26,代码来源:RequestContext.php


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