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


PHP EntryManager::fetchEntryFieldSchema方法代码示例

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


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

示例1: grab

 function grab($param = array())
 {
     extract($this->_env, EXTR_PREFIX_ALL, 'env');
     include_once TOOLKIT . '/class.entrymanager.php';
     $entryManager = new EntryManager($this->_parent);
     $section_id = $entryManager->fetchSectionIDFromHandle($this->__resolveDefine("dsFilterPARENTSECTION"));
     $schema = $entryManager->fetchEntryFieldSchema($section_id, NULL, $this->_dsFilterCUSTOMFIELD);
     $schema = $schema[0];
     ##Check the cache
     $hash_id = md5(get_class($this));
     if ($param['caching'] && ($cache = $this->check_cache($hash_id))) {
         return $cache;
         exit;
     }
     ##------------------------------
     ##Create the XML container
     $xml = new XMLElement("categories-list");
     $xml->setAttribute("section", "customfield");
     ##Populate the XML
     if (empty($schema) || !is_array($schema)) {
         $xml->addChild(new XMLElement("error", "No Records Found."));
         return $xml;
     } else {
         $ops = preg_split('/,/', $schema['values'], -1, PREG_SPLIT_NO_EMPTY);
         $ops = array_map("trim", $ops);
         $xml->addChild(new XMLElement("name", $schema['name']));
         $xml->setAttribute("handle", $schema['handle']);
         $options = new XMLElement("options");
         foreach ($ops as $o) {
             if ($schema['type'] == 'multiselect') {
                 $table = 'tbl_entries2customfields_list';
             } else {
                 $table = 'tbl_entries2customfields';
             }
             $count = $this->_db->fetchVar('count', 0, "SELECT count(id) AS `count` FROM `{$table}` WHERE `field_id` = '" . $schema['id'] . "' AND value_raw = '{$o}' ");
             $xO = new XMLElement("option", $o);
             $xO->setAttribute('entry-count', $count);
             $xO->setAttribute('handle', Lang::createHandle($o, $this->_parent->getConfigVar('handle_length', 'admin')));
             $options->addChild($xO);
         }
         $xml->addChild($options);
     }
     ##------------------------------
     ##Write To Cache
     if ($param['caching']) {
         $result = $xml->generate($param['indent'], $param['indent-depth']);
         $this->write_to_cache($hash_id, $result, $this->_cache_sections);
         return $result;
     }
     return $xml;
 }
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:51,代码来源:data.categories_list.php

示例2: unset

    $about = $TFM->about($fields['formatter']);
    $entry_formatter = $about['name'];
    $about = $TFM->about($Admin->getAuthorTextFormatter());
    $author_formatter = $about['name'];
    unset($TFM);
    if ($entry_formatter != $author_formatter) {
        $Admin->pageAlert("diff-formatter", array($entry_formatter ? $entry_formatter : "raw XHTML", $author_formatter ? $author_formatter : "raw XHTML"), false, 'error');
    }
}
if (!empty($_POST['fields'])) {
    $fields = $_POST['fields'];
    $date->set(strtotime($fields["time"] . " " . $fields['publish_date']));
} else {
    $date->set($fields['timestamp_gmt'], false);
}
$upload_fields = $entryManager->fetchEntryFieldSchema($_REQUEST['_sid'], array('upload'));
foreach ($upload_fields as $row) {
    if ($row['type'] == 'upload' && !@is_writable(DOCROOT . "/" . $row['destination_folder'])) {
        $Admin->fatalError("Upload Path Not Writable", "<p>The upload path <code>" . $row['destination_folder'] . "</code>, used by your '" . $row['name'] . "' upload custom field, is not writable and needs to be corrected before you can publish to this section.</p>", true, true);
        exit;
    }
}
$field_schema = $entryManager->fetchEntryFieldSchema($section_id);
$drawer = createMarkupForLocation("drawer", $fields, $field_schema);
$sidebar = createMarkupForLocation("sidebar", $fields, $field_schema);
$main_content = createMarkupForLocation("main", $fields, $field_schema);
?>

	<form id="entry" action="<?php 
print $Admin->getCurrentPageURL() . "&amp;id=" . $entry_id . "&amp;_sid=" . $section_id;
?>
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_publish_section_edit.php

示例3: array

    $Admin->pageAlert("required", array(ucwords(@implode(", ", $required))), false, 'error');
}
if (!empty($_POST)) {
    $fields = $_POST['fields'];
    $fields['static_xml'] = General::sanitize($fields['static_xml']);
} else {
    $fields = array();
    $fields['format_type'] = 'list';
    $fields['max_records'] = 50;
    $fields['page_number'] = 1;
}
include_once TOOLKIT . "/class.entrymanager.php";
$EM = new EntryManager($Admin);
$can_use_customfield_source = false;
foreach ($sections as $s) {
    $schema = $EM->fetchEntryFieldSchema($s['id'], array("select", "multiselect"));
    if (is_array($schema) && !empty($schema)) {
        $can_use_customfield_source = true;
        break 1;
    }
}
?>
	<form id="settings" action="" method="post">
	  	<h2>Untitled</h2>

		<fieldset>
			<fieldset>
				<legend>Essentials</legend>

				<div class="group">
					<label>Name <input name="fields[name]" <?php 
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_blueprint_datasources_new.php


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