本文整理汇总了PHP中KT类的典型用法代码示例。如果您正苦于以下问题:PHP KT类的具体用法?PHP KT怎么用?PHP KT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KT类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: kt_sql_create_sql
/**
* Založí tabulku dle zadaného názvu (pro kontrolu) a SQL skriptu
* s
* @author Martin Hlaváč
* @link http://www.ktstudio.cz
*
* @param string $tableName
* @param string $sql
* @return boolean
* @global \WPDB $wpdb
*/
function kt_sql_create_sql($tableName, $sql)
{
/* @var $wpdb \WPDB */
global $wpdb;
if (KT::issetAndNotEmpty($tableName) && KT::issetAndNotEmpty($sql)) {
if (strcasecmp($wpdb->get_var("SHOW TABLES LIKE '{$tableName}'"), $tableName) !== 0) {
if ($wpdb->query($sql)) {
return true;
}
}
}
return false;
}
开发者ID:Nodonisko,项目名称:WP-Framework,代码行数:24,代码来源:kt_sql_functions.inc.php
示例17: initPosts
private function initPosts()
{
$args = array("post_type" => KT_ZZZ_SLIDER_KEY, "post_status" => "publish", "posts_per_page" => self::DEFAULT_COUNT, "orderby" => "menu_order title", "order" => KT_Repository::ORDER_ASC);
$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_sliders_presenter.inc.php
示例18: getCatalogBaseFieldset
/**
* Vrátí základní fieldset pro číselník
*
* @author Martin Hlaváč
* @link http://www.ktstudio.cz
*
* @param string $name
* @param string $prefix
* @param KT_Catalog_Model_Base $item
* @return \KT_Form_Fieldset
*/
public static function getCatalogBaseFieldset($name, $prefix, $title = null, KT_Catalog_Model_Base $item = null)
{
$fieldset = new KT_Form_Fieldset($name, $title);
$fieldset->setPostPrefix($prefix);
$fieldset->addText(KT_Catalog_Model_Base::TITLE_COLUMN, __("Název*: ", KT_DOMAIN))->addRule(KT_Field_Validator::REQUIRED, "Název je povinná položka", KT_DOMAIN)->addRule(KT_Field_Validator::MIN_LENGTH, __("Název musí mít alespoň 3 znaky", KT_DOMAIN), 3)->addRule(KT_Field_Validator::MAX_LENGTH, __("Název může mít maximálně 50 znaků", KT_DOMAIN), 50);
$fieldset->addTextarea(KT_Catalog_Model_Base::DESCRIPTION_COLUMN, __("Popis: ", KT_DOMAIN))->setRows(5)->setTooltip(__("Doplňující údaj informačního charakteru...", KT_DOMAIN));
$fieldset->addText(KT_Catalog_Model_Base::CODE_COLUMN, __("Kód: ", KT_DOMAIN))->addAttribute("maxlength", 30)->addRule(KT_Field_Validator::MAX_LENGTH, __("Kód může mít maximálně 30 znaků", KT_DOMAIN), 30);
$fieldset->addSwitch(KT_Catalog_Model_Base::VISIBILITY_COLUMN, __("Viditelnost*: ", KT_DOMAIN))->setValue(KT_Switch_Field::YES)->addRule(KT_Field_Validator::REQUIRED, __("Viditelnost je povinná položka", KT_DOMAIN));
if (KT::issetAndNotEmpty($item) && $item->isInDatabase()) {
$fieldset->addHidden(KT_Catalog_Model_Base::ID_COLUMN)->setValue($item->getId());
$fieldset->setFieldsData($item->getData());
}
return $fieldset;
}
开发者ID:Nodonisko,项目名称:WP-Framework,代码行数:25,代码来源:kt_catalog_base_config.inc.php
示例19: kt_cron_schedules_metabox_callback
function kt_cron_schedules_metabox_callback()
{
$schedules = wp_get_schedules();
if (KT::arrayIssetAndNotEmpty($schedules)) {
echo "<ol>";
foreach ($schedules as $key => $values) {
if (KT::arrayIssetAndNotEmpty($values)) {
$interval = KT::arrayTryGetValue($values, "interval");
$display = KT::arrayTryGetValue($values, "display");
echo "<li><b>{$key}</b> (<i>{$display}</i>) - {$interval} [s]</li>";
}
}
echo "</ol>";
}
}
开发者ID:ktstudio,项目名称:wp-framework,代码行数:15,代码来源:kt_wp_cron_metabox.admin.inc.php
示例20: getNumber
/**
* Vrátí číslo (v podstatě ID) právě na základě ID property, resp. její číselné přípony
*
* @author Martin Hlaváč
* @link http://www.ktstudio.cz
*
* @return int
*/
public function getNumber()
{
$id = $this->getId();
if (KT::issetAndNotEmpty($id)) {
$parts = explode("-", $id);
$parts = array_reverse($parts);
$number = KT::tryGetInt($parts[0]);
if (KT::isIdFormat($number)) {
return $number;
} else {
return next_widget_id_number($this->getName());
}
}
return 0;
}
开发者ID:Nodonisko,项目名称:WP-Framework,代码行数:23,代码来源:kt_widget_base.inc.php
注:本文中的KT类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论