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


PHP CustomFields::getBlogCustomFields方法代碼示例

本文整理匯總了PHP中CustomFields::getBlogCustomFields方法的典型用法代碼示例。如果您正苦於以下問題:PHP CustomFields::getBlogCustomFields方法的具體用法?PHP CustomFields::getBlogCustomFields怎麽用?PHP CustomFields::getBlogCustomFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CustomFields的用法示例。


在下文中一共展示了CustomFields::getBlogCustomFields方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 /**
  * load the fields and pass them to the view
  */
 function render()
 {
     // load the custom fields that have been defined so far
     $customFields = new CustomFields();
     $blogFields = $customFields->getBlogCustomFields($this->_blogInfo->getId(), true, $this->_page, DEFAULT_ITEMS_PER_PAGE);
     $this->notifyEvent(EVENT_CUSTOM_FIELDS_LOADED, array("fields" => &$blogFields));
     // and the total number of them too
     $numBlogFields = $customFields->getNumBlogCustomFields($this->_blogInfo->getId());
     // create the pager
     $pager = new Pager("?op=blogCustomFields&page=", $this->_page, $numBlogFields, DEFAULT_ITEMS_PER_PAGE);
     // and show them
     $this->setValue("fields", $blogFields);
     $this->setValue("pager", $pager);
     return parent::render();
 }
開發者ID:BackupTheBerlios,項目名稱:plogfr-svn,代碼行數:18,代碼來源:admincustomfieldslistview.class.php

示例2: render

 function render()
 {
     // fetch the categories
     $categories = new ArticleCategories();
     $blogSettings = $this->_blogInfo->getSettings();
     $categoriesOrder = $blogSettings->getValue("categories_order");
     $blogCategories = $categories->getBlogCategories($this->_blogInfo->getId(), false, $categoriesOrder);
     // get some stuff for the time stamp of the post, which is changeable now
     //$t = new Timestamp();
     $t = Timestamp::getBlogDate($this->_blogInfo);
     //$t->toUTC();
     //
     // changes to make plog store its dates with the time difference already
     // applied, instead of applying it dynamically
     //
     $config =& Config::getConfig();
     /*if( $config->getValue( "time_difference_calculation" == TIME_DIFFERENCE_CALCULATION_STATIC ) {
     		$blogSettings = $this->_blogInfo->getSettings();
     		$difference = $blogSettings->getValue( "time_offset" );
               	$t->setDate( Timestamp::getDateWithOffset( $t->getDate(), $difference ), DATE_FORMAT_TIMESTAMP );
           	}*/
     // fetch the custom fields, if any, but not including the ones that have been set to "hidden"...
     $customFields = new CustomFields();
     $blogFields = $customFields->getBlogCustomFields($this->_blogInfo->getId(), false);
     // and put everything in the template
     $locale = $this->_blogInfo->getLocale();
     $this->setValue("commentsEnabled", $blogSettings->getValue("comments_enabled"));
     $this->setValue("categories", $blogCategories);
     $this->setValue("today", $t);
     $this->setValue("months", $locale->getMonthNames());
     $this->setValue("days", $locale->getDayNamesShort());
     $this->setValue("years", Timestamp::getYears());
     $this->setValue("hours", Timestamp::getAllHours());
     $this->setValue("minutes", Timestamp::getAllMinutes());
     $this->setValue("customfields", $blogFields);
     $this->setValue("poststatus", ArticleStatus::getStatusList());
     $this->setValue("sendPings", $config->getValue("send_xmlrpc_pings_enabled_by_default", true));
     $this->setValue("xmlRpcPingEnabled", $config->getValue("xmlrpc_ping_enabled", false));
     $this->setValue("autoSaveNewDraftsTimeMillis", $config->getValue("autosave_new_drafts_time_millis"));
     $this->setValue("xmlHttpRequestSupportEnabled", $config->getValue("save_drafts_via_xmlhttprequest_enabled"));
     $this->setValue("postDateTime", $t->getDay() . "/" . $t->getMonth() . "/" . $t->getYear() . " " . $t->getHour() . ":" . $t->getMinutes());
     parent::render();
 }
開發者ID:BackupTheBerlios,項目名稱:plogfr-svn,代碼行數:43,代碼來源:adminnewpostview.class.php

示例3: CustomFields

 /**
  * checks if the fields already exist and if so, disables them (sets them to be "hidden")
  */
 function _updateFields()
 {
     $customFields = new CustomFields();
     $blogFields = $customFields->getBlogCustomFields($this->_blogInfo->getId());
     // check if the checkbox fields exists
     if (array_key_exists("password_protected", $blogFields)) {
         _debug("hiding! password field!");
         $protectedField = $blogFields["password_protected"];
         $protectedField->setHidden(true);
         $customFields->updateCustomField($protectedField);
     }
     // check if the field for the password exists
     if (array_key_exists("password_field", $blogFields)) {
         _debug("hiding! pass-word field!");
         $passwordField = $blogFields["password_field"];
         $passwordField->setHidden(true);
         $customFields->updateCustomField($passwordField);
     }
     return true;
 }
開發者ID:BackupTheBerlios,項目名稱:plogfr-svn,代碼行數:23,代碼來源:adminsecretpluginupdatesettingsaction.class.php


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