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


PHP KT类代码示例

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


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

示例1: getMetas

 /**
  * Vrátí pole s metas
  * 
  * @return array
  */
 public final function getMetas()
 {
     if (KT::notIssetOrEmpty($this->metas)) {
         $this->initMetas();
     }
     return $this->metas;
 }
开发者ID:Nodonisko,项目名称:WP-Framework,代码行数:12,代码来源:kt_meta_model_base.inc.php

示例2: getOptionsData

 /**
  * @return array
  */
 public function getOptionsData()
 {
     if (KT::issetAndNotEmpty($this->dataManager)) {
         return $this->getDataManager()->getData();
     }
     return array();
 }
开发者ID:ktstudio,项目名称:wp-framework,代码行数:10,代码来源:kt_options_field_base.inc.php

示例3: removeMetabox

 /**
  * Zruší metabox na základě názvu, stránky a contextu
  *
  * @param string $metaboxId
  * @param string $postType
  * @param string $context
  * @return \KT_WP_Metabox_Remover_Configurator
  */
 public function removeMetabox($metaboxId, $postType, $context)
 {
     if (KT::issetAndNotEmpty($metaboxId) && KT::issetAndNotEmpty($postType) && KT::issetAndNotEmpty($context)) {
         array_push($this->data, array($metaboxId, $postType, $context));
     }
     return $this;
 }
开发者ID:Nodonisko,项目名称:WP-Framework,代码行数:15,代码来源:kt_wp_metabox_remover_configurator.inc.php

示例4: removeWidget

 /**
  * Zruší widget na základě názvu
  *
  * @author Martin Hlaváč
  * @link http://www.ktstudio.cz
  * 
  * @param string $widgetName
  * @return \KT_WP_Widget_Remover_Configurator
  */
 public function removeWidget($widgetName)
 {
     if (KT::issetAndNotEmpty($widgetName)) {
         array_push($this->data, $widgetName);
     }
     return $this;
 }
开发者ID:Nodonisko,项目名称:WP-Framework,代码行数:16,代码来源:kt_wp_widget_remover_configurator.inc.php

示例5: renderPrevReferenceLink

 public function renderPrevReferenceLink()
 {
     $adjacent = get_adjacent_post(false, "", true);
     if (KT::issetAndNotEmpty($adjacent)) {
         $url = get_permalink($adjacent->ID);
         echo "<a href=\"{$url}\" title=\"Předchozí naše práce\" class=\"prev\">Předchozí reference</a>";
     }
 }
开发者ID:ktstudio,项目名称:WPFW-Skeleton,代码行数:8,代码来源:kt_zzz_reference_presenter.inc.php

示例6: kt_zzz_load_more_posts_callback

function kt_zzz_load_more_posts_callback()
{
    if (KT::arrayIssetAndNotEmpty($_REQUEST)) {
        $presenter = new KT_ZZZ_Posts_Presenter();
        die($presenter->getPostsOutput());
    }
    die(false);
}
开发者ID:ktstudio,项目名称:WPFW-Skeleton,代码行数:8,代码来源:kt_zzz_general_functions.inc.php

示例7: __construct

 /**
  * @param string $action - WP nonce akce
  * @param string $name - hash v poli
  * @param string $label - popisek v HTML
  */
 public function __construct($action, $name, $label)
 {
     parent::__construct($name, $label);
     if (KT::issetAndNotEmpty($action)) {
         $this->action = $action;
     } else {
         throw new KT_Not_Supported_Exception("Empty Nonce Action");
     }
 }
开发者ID:ktstudio,项目名称:wp-framework,代码行数:14,代码来源:kt_wp_nonce_field.inc.php

示例8: getNameAttribute

 protected function getNameAttribute()
 {
     $afterNameString = static::getAfterNameValue();
     if (KT::issetAndNotEmpty($this->getPostPrefix())) {
         return "{$this->getPostPrefix()}[{$this->getName()}]{$afterNameString}";
     } else {
         return "{$this->getName()}{$afterNameString}";
     }
 }
开发者ID:ktstudio,项目名称:wp-framework,代码行数:9,代码来源:kt_wp_editor_field.inc.php

示例9: pageQueryArgsInit

 /**
  * Objektu automaticky nastaví query po selekci stránek
  * 
  * @return \KT_Page_Field
  */
 private function pageQueryArgsInit()
 {
     $args = array("post_type" => KT_WP_PAGE_KEY, "posts_per_page" => self::DEFAUL_PAGE_COUNT, "post_status" => "publish", "orderby" => "parent title", "order" => KT_Repository::ORDER_ASC);
     if (KT::issetAndNotEmpty($this->getParentPage())) {
         $args["post_parent"] = $this->getParentPage();
     }
     $dataManager = new KT_Custom_Post_Data_Manager();
     $dataManager->setQueryArgs($args);
     $this->setDataManager($dataManager);
 }
开发者ID:Nodonisko,项目名称:WP-Framework,代码行数:15,代码来源:kt_page_field.inc.php

示例10: getAllTermsByTaxonomy

 /**
  * Vytažení všech termů pro zadané taxonomy vlastním způsobem ve formátu [ID, slug, name]
  *
  * @author Martin Hlaváč
  * @link http://www.ktstudio.cz
  * @link http://codeblow.com/questions/wordpress-get-terms-function-no-longer-working-during-my-wordpress-plugin/
  *
  * @global $wpdb
  * @param string $taxonomyName
  * @return array
  * @throws KT_Not_Set_Argument_Exception
  */
 public static function getAllTermsByTaxonomy($taxonomyName)
 {
     if (KT::issetAndNotEmpty($taxonomyName)) {
         global $wpdb;
         $query = "SELECT DISTINCT {$wpdb->terms}.term_id as ID, {$wpdb->terms}.slug as slug, {$wpdb->terms}.name as name\n\t\t\t\t\t  FROM {$wpdb->terms}\n\t\t\t\t\t  LEFT JOIN {$wpdb->term_taxonomy}\n\t\t\t\t\t  ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id\n\t\t\t\t\t  WHERE {$wpdb->term_taxonomy}.taxonomy = '%s'\n\t\t\t\t\t  ORDER BY {$wpdb->terms}.name";
         $results = $wpdb->get_results($wpdb->prepare($query, $taxonomyName), ARRAY_A);
         return $results;
     }
     throw new KT_Not_Set_Argument_Exception("taxonomy");
 }
开发者ID:ktstudio,项目名称:wp-framework,代码行数:22,代码来源:kt_wp_term_base_presenter.inc.php

示例11: getField

 /**
  * Vrátí HTML strukturu pro zobrazní fieldu
  *
  * @author Tomáš Kocifaj
  * @link http://www.ktstudio.cz
  *
  * @return string
  */
 public function getField()
 {
     $html = "";
     $html .= "<textarea " . $this->getBasicHtml() . ">";
     $html .= KT::stringHtmlDecode($this->getValue());
     $html .= "</textarea>";
     if ($this->hasErrorMsg()) {
         $html .= parent::getHtmlErrorMsg();
     }
     return $html;
 }
开发者ID:Nodonisko,项目名称:WP-Framework,代码行数:19,代码来源:kt_textarea_field.inc.php

示例12: getParamsFieldset

 public static function getParamsFieldset()
 {
     $fieldset = new KT_Form_Fieldset(self::PARAMS_FIELDSET, __("Parametry", "ZZZ_ADMIN_DOMAIN"));
     $fieldset->setPostPrefix(self::PARAMS_FIELDSET);
     $referenceTypes = new KT_ZZZ_Reference_Type_Enum();
     $referenceOptions = KT::arrayRemoveByKey($referenceTypes->getTranslates(), KT_ZZZ_Reference_Type_Enum::NONE);
     $fieldset->addText(self::PARAMS_DATE, __("Datum:", "ZZZ_ADMIN_DOMAIN"));
     $fieldset->addText(self::PARAMS_CLIENT, __("Klient:", "ZZZ_ADMIN_DOMAIN"));
     $fieldset->addCheckbox(self::PARAMS_TYPES, __("Typy:", "ZZZ_ADMIN_DOMAIN"))->setOptionsData($referenceOptions);
     return $fieldset;
 }
开发者ID:ktstudio,项目名称:WPFW-Skeleton,代码行数:11,代码来源:kt_zzz_reference_config.inc.php

示例13: getList

 /**
  * Na základě odřádkování (tzn. po řádcích) rozdělí zadaný text a vrátí jako HTML seznam zadaného tagu
  * 
  * @author Martin Hlaváč
  * @link http://www.ktstudio.cz
  * 
  * @param string $format @see sprintf()
  * @return string (HTML)
  */
 public function getList($format = "%s", $unsafe = false)
 {
     $lines = $this->getLinesArray($unsafe);
     if (!KT::arrayIssetAndNotEmpty($lines)) {
         return;
     }
     $output = "";
     foreach ($lines as $line) {
         $output .= sprintf($format, $line);
     }
     return $output;
 }
开发者ID:ktstudio,项目名称:wp-framework,代码行数:21,代码来源:kt_string_text.inc.php

示例14: kt_edit_sorting_crud_list_callback

/**
 * Funkce obslouží ajax dotaz, který má provést uložení pořadí itemů po Sortable
 * 
 * @author Tomáš Kocifaj
 * @link http://www.ktstudio.cz
 */
function kt_edit_sorting_crud_list_callback()
{
    $itemCollection = $_REQUEST["data"];
    $className = $_REQUEST["class_name"];
    if (KT::arrayIssetAndNotEmpty($itemCollection)) {
        foreach ($itemCollection as $index => $itemId) {
            $crudClassObject = new $className($itemId);
            if ($crudClassObject->isInDatabase()) {
                $crudClassObject->setMenuOrder($index)->saveRow();
            }
        }
    }
}
开发者ID:ktstudio,项目名称:wp-framework,代码行数:19,代码来源:kt_general_functions.inc.php

示例15: initPosts

 private function initPosts()
 {
     $args = array("post_type" => KT_WP_POST_KEY, "post_status" => "publish", "posts_per_page" => self::DEFAULT_COUNT, "orderby" => "date", "order" => KT_Repository::ORDER_DESC, "cat" => KT_ZZZ::getThemeModel()->getCategoryNewsId());
     $query = new WP_Query();
     $posts = $query->query($args);
     if (KT::arrayIssetAndNotEmpty($posts)) {
         $this->posts = $posts;
         $this->postsCount = count($posts);
     } else {
         $this->posts = array();
         $this->postsCount = 0;
     }
 }
开发者ID:ktstudio,项目名称:WPFW-Skeleton,代码行数:13,代码来源:kt_zzz_news_presenter.inc.php


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