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


PHP General::fieldValue方法代码示例

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


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

示例1: array

    print General::fieldValue("select", $fields['location'], "", "main");
    ?>
>Main Content</option>
						<option value="sidebar" <?php 
    print General::fieldValue("select", $fields['location'], "", "sidebar");
    ?>
>Sidebar</option>
						<option value="drawer" <?php 
    print General::fieldValue("select", $fields['location'], "", "drawer");
    ?>
>Drawer</option>
					</select>
				</label>

				<label><input name="fields[required]" type="checkbox" <?php 
    print !in_array($fields['type'], array('upload', 'checkbox')) && $fields['location'] != 'drawer' ? General::fieldValue("checkbox", $fields['required'], "", "on") : 'disabled="disabled"';
    ?>
 /> Required Field</label>
			</fieldset>
<?php 
} else {
    $message = 'This custom field is linked to the <a href="' . URL . '/symphony/?page=/blueprint/sections/edit/&amp;id=' . $section['id'] . '">' . $section['name'] . '</a> section, so you cannot delete or re-associate it, and it must use either a text input or text area field type.';
    if ($section['id'] != 1) {
        $message .= ' It will automatically be removed if you delete the ' . $section['name'] . ' section.';
    }
    ?>
				<p class="fixed"><?php 
    print $message;
    ?>
</p>
<?php 
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_structure_customfields_edit.php

示例2: foreach

			</fieldset>

			<fieldset>
				<legend>Miscellaneous</legend>
				<label>Formatting Preference
					<select name="fields[textformat]">
						<option value="">None</option>
<?php 
foreach ($formatters as $name => $about) {
    ?>
						<option value="<?php 
    print $name;
    ?>
" <?php 
    print General::fieldValue("select", $fields['textformat'] == $name);
    ?>
><?php 
    print $about['name'];
    ?>
</option>

<?php 
}
?>
					</select>
				</label>
				<label><input name="fields[auth_token_active]" type="checkbox" value='yes' <?php 
print $fields['auth_token_active'] == 'yes' ? 'checked="checked" ' : '';
?>
/> Enable author token</label>
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:30,代码来源:sym_settings_authors_new.php

示例3:

        print $u['name'];
        ?>
</a></li>
<?php 
    }
}
?>
					</ul>
				</fieldset>
			</fieldset>
			<label>Name <input name="fields[name]" type="text" <?php 
print General::fieldValue("value", $fields['name']);
?>
 /></label>
			<label>Body <textarea id="code-editor" cols="75" rows="25" name="fields[body]"><?php 
print General::fieldValue("textarea", $fields['body']);
?>
</textarea></label>
			<input name="action[save]" type="submit" value="Save" accesskey="s" />
			<input name="action[delete]" type="image" src="assets/images/buttons/delete.png" title="Delete this template" />

		</fieldset>
		<div id="config">
			<h3>Master Settings</h3>
			<fieldset>
				<legend>Master Environment</legend>
				<div class="group">
					<label>Data Source <acronym title="eXtensible Markup Language">XML</acronym>
						<select name="fields[data_sources][]" multiple="multiple">
<?php 
if (is_array($datasources) && !empty($datasources)) {
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_blueprint_masters_edit.php

示例4: EventManager

$datasources = $DSM->listAll();
$EM = new EventManager(array('parent' => &$Admin));
$events = $EM->listAll();
$fields['name'] = strtolower($fields['name']);
?>
	<form action="<?php 
print $Admin->getCurrentPageURL();
?>
&amp;id=<?php 
print $_GET['id'];
?>
" method="post">
  	<h2>Untitled</h2>
		<fieldset>
			<label>Name <input name="fields[name]" <?php 
print General::fieldValue("value", $fields['name']);
?>
 /></label>
			<fieldset>
				<label>Associate with Data Source
					<select multiple="multiple" name="fields[data_source][]">

<?php 
if (is_array($datasources) && !empty($datasources)) {
    foreach ($datasources as $d) {
        print '<option value="' . $d['handle'] . '" ' . (@in_array($d['handle'], $fields['data_source']) ? ' selected="selected"' : '') . '>' . $d['name'] . '</option>' . "\n";
    }
}
?>
					</select>
				</label>
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_blueprint_utilities_new.php

示例5: createMarkupForLocation

function createMarkupForLocation($location, $fields, $field_schema)
{
    global $DB;
    if (!is_array($field_schema) || empty($field_schema)) {
        return NULL;
    }
    $code = NULL;
    foreach ($field_schema as $row) {
        if ($location == $row['location']) {
            if ($row['type'] != 'upload' && $row['type'] != 'checkbox') {
                $code .= "<label>" . $row['name'];
                if (trim($row['description']) != "") {
                    $code .= "<small>" . $row['description'] . "</small>" . CRLF;
                }
            }
            switch ($row['type']) {
                case 'textarea':
                    $row['size'] = min(120, $row['size']);
                    $row['size'] = max(6, $row['size']);
                    $value = $fields["custom"][$row['handle']];
                    if (!empty($_POST['fields'])) {
                        $value = General::sanitize($value);
                    }
                    $code .= '<textarea name="fields[custom][' . $row['handle'] . ']" rows="' . $row['size'] . '" cols="75">' . General::fieldValue("textarea", $value, $row['value']) . '</textarea></label>' . CRLF;
                    break;
                case 'input':
                    $value = $fields["custom"][$row['handle']];
                    if (!empty($_POST['fields'])) {
                        $value = General::sanitize($value);
                    }
                    $code .= '<input name="fields[custom][' . $row['handle'] . ']" ' . General::fieldValue("value", $value, $row['value']) . ' /></label>' . CRLF;
                    break;
                case 'list':
                    if (is_array($fields["custom"][$row['handle']])) {
                        $fields["custom"][$row['handle']] = @implode(", ", $fields["custom"][$row['handle']]);
                    }
                    $value = $fields["custom"][$row['handle']];
                    if (!empty($_POST['fields'])) {
                        $value = General::sanitize($value);
                    }
                    $code .= '<input name="fields[custom][' . $row['handle'] . ']" ' . General::fieldValue("value", $fields["custom"][$row['handle']], $row['value']) . ' /></label>' . CRLF;
                    break;
                case 'foreign':
                    if ($row['foreign_select_multiple'] == 'yes') {
                        $code .= '<select multiple="multiple" name="fields[custom][' . $row['handle'] . '][]">' . CRLF;
                    } else {
                        $code .= '<select name="fields[custom][' . $row['handle'] . ']">' . CRLF;
                        if ($row['required'] == 'no') {
                            $code .= '<option value=""></option>' . CRLF;
                        }
                    }
                    $sql = "SELECT * FROM `tbl_sections` WHERE `id` = '" . $row['foreign_section'] . "'";
                    $section = $DB->fetchRow(0, $sql);
                    $sql = "SELECT * FROM `tbl_entries2customfields` WHERE `field_id` = '" . $section['primary_field'] . "' ORDER BY `value_raw` ASC";
                    $values = $DB->fetch($sql);
                    foreach ($values as $option) {
                        $o = NULL;
                        $o = General::limitWords($option['value'], 100, true, true);
                        $h = $option['handle'];
                        if ($row['foreign_select_multiple'] == 'yes') {
                            $code .= '<option ' . (@in_array($h, $fields["custom"][$row['handle']]) ? 'selected="selected"' : '') . ' value="' . $h . '">' . $o . "</option>" . CRLF;
                        } else {
                            $code .= '<option ' . General::fieldValue("select", $fields["custom"][$row['handle']], "", $h) . ' value="' . $h . '">' . $o . "</option>" . CRLF;
                        }
                    }
                    $code .= "</select></label>" . CRLF;
                    break;
                case 'multiselect':
                    $code .= '<select multiple="multiple" name="fields[custom][' . $row['handle'] . '][]">' . CRLF;
                    $options = preg_split('/,/', $row['values'], -1, PREG_SPLIT_NO_EMPTY);
                    $options = array_map("trim", $options);
                    foreach ($options as $o) {
                        $o = General::sanitize($o);
                        $code .= '<option ' . (@in_array($o, $fields["custom"][$row['handle']]) ? 'selected="selected"' : '') . ' value="' . $o . '">' . $o . "</option>" . CRLF;
                    }
                    $code .= "</select></label>" . CRLF;
                    break;
                case 'checkbox':
                    $code .= '
					<label><input name="fields[custom][' . $row['handle'] . ']" type="checkbox" ' . General::fieldValue("checkbox", $fields['custom'][$row['handle']], "", "yes") . ' /> ' . ($row['description'] != '' ? $row['description'] : $row['name']) . '</label>' . CRLF;
                    break;
                case 'upload':
                    $code .= '							<div class="attachment">' . $row['name'] . ' ' . (trim($row['description']) != "" ? '<small>' . $row['description'] . '</small>' : '') . '
							<div><input name="fields[custom][' . $row['handle'] . '][]" type="file" /></div>' . CRLF;
                    $tmp_files = $fields["custom"][$row['handle']];
                    if (is_array($tmp_files) && !empty($tmp_files)) {
                        $code .= '							<ul>' . CRLF;
                        unset($tmp_files['upload_directory']);
                        unset($tmp_files['deleted_files']);
                        foreach ($tmp_files as $f) {
                            $code .= '			<li><a href="' . URL . $f['path'] . '">' . $f['path'] . '</a></li>' . CRLF;
                        }
                        $code .= '							</ul>' . CRLF;
                    }
                    $code .= '							<input name="fields[custom][' . $row['handle'] . '][upload_directory]" type="hidden" value="' . $row['destination_folder'] . '" />
							<input name="fields[custom][' . $row['handle'] . '][deleted_files]" type="hidden" value="" />
						</div>' . CRLF;
                    break;
                case 'select':
                    $code .= '<select name="fields[custom][' . $row['handle'] . ']">' . CRLF;
//.........这里部分代码省略.........
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:101,代码来源:sym_publish_section_edit.php

示例6: foreach

					</select>
				</label>

				<label><input name="fields[show_in_nav]" type="checkbox"<?php 
print $fields['show_in_nav'] == "no" ? ' checked="checked"' : "";
?>
 /> Hide this page from my navigation</label>
			</fieldset>
			<fieldset>
				<legend>Caching Options</legend>
				<label><input name="fields[full_caching]" type="checkbox"<?php 
print $fields['full_caching'] == "yes" ? ' checked="checked"' : "";
?>
 /> Enable full page caching for this page</label>
				<label>Refresh the cache every <input name="fields[cache_refresh_rate]" <?php 
print General::fieldValue("value", $fields['cache_refresh_rate'], ' value="59"');
?>
 size="3" /> minutes.</label>
			</fieldset>
			<fieldset>
				<legend>Page Environment</legend>
				<div class="group">
					<label>Data Source <acronym title="eXtensible Markup Language">XML</acronym>
						<select name="fields[data_sources][]" multiple="multiple">
<?php 
if (is_array($datasources) && !empty($datasources)) {
    foreach ($datasources as $name => $about) {
        print '<option value="' . $name . '" ' . (@in_array($name, $fields['data_sources']) ? ' selected="selected"' : '') . '>' . $about['name'] . '</option>' . "\n";
    }
}
?>
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_blueprint_pages_new.php

示例7:

</textarea></label>
			<fieldset>
				<label>Name <input name="fields[author_name]" <?php 
print General::fieldValue("value", $fields["author_name"]);
?>
 /></label>
				<label>Email Address <input name="fields[author_email]" <?php 
print General::fieldValue("value", $fields["author_email"]);
?>
 /></label>
				<label>Website <input name="fields[author_url]" <?php 
print General::fieldValue("value", General::validateURL($fields["author_url"]));
?>
 /></label>
				<label><acronym title="Internet Protocol">IP</acronym> Address <input name="fields[author_ip]" <?php 
print General::fieldValue("value", $fields["author_ip"]);
?>
 /></label>
				<label><input name="fields[spam]" type="checkbox" <?php 
print $fields['spam'] == "yes" ? ' checked="checked"' : "";
?>
 /> Flag this comment as spam</label>
				<label><input name="fields[blacklist]" type="checkbox" <?php 
print $fields['blacklist'] == "yes" ? ' checked="checked"' : "";
?>
 /> Blacklist this users <acronym title="Internet Protocol">IP</acronym> Address</label>
			</fieldset>
			<input name="action[save]" type="submit" value="Save" />
			<input name="action[delete]" type="image" src="assets/images/buttons/delete.png" title="Delete this comment" />
		</fieldset>
	</form>
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_publish_comments_edit.php

示例8: month

				<legend>Limit Options</legend>
				<div class="group">
<?php 
if (isset($fields['max_months'])) {
    ?>
					<label>Show a maximum of <input name="fields[max_months]" size="3" maxlength="3" <?php 
    print General::fieldValue("value", $fields['max_months'], "12");
    ?>
> month(s).</label>
<?php 
} else {
    ?>
					<label>Show a maximum of <input name="fields[max_records]" size="3" maxlength="3" <?php 
    print General::fieldValue("value", $fields['max_records'], "50");
    ?>
 /> record(s).</label>

<?php 
}
?>
					<label>Show page <input name="fields[page_number]" size="3" <?php 
print General::fieldValue("value", $fields['page_number'], "");
?>
 /> of results. <small>Accepts <code>$param</code> values</small></label>

				</div>
			</fieldset>

			<input name="action[save]" type="submit" value="Save" accesskey="s" />
		</fieldset>
	</form>
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_blueprint_datasources_new.php

示例9:

>Author</option>
						</select>
					</label>
				</fieldset>

				<label>Name <input name="fields[name]" <?php 
print General::fieldValue("value", $fields['name']);
?>
 /></label>
				<label><input name="fields[commenting]" type="checkbox" <?php 
print General::fieldValue("checkbox", $fields["commenting"], "", 1);
?>
 /> Enable comments for this section</label>
				<label><input name="fields[calendar_show]" type="checkbox" <?php 
print General::fieldValue("checkbox", $fields["calendar_show"], "", 1);
?>
 /> Show the 'Published Date and Time' widget when creating and editing entries in this section</label>
				<div id="columns">Show the following columns
					<label><input name="fields[author_column]" type="checkbox" <?php 
print General::fieldValue("checkbox", $fields["author_column"], "", 1);
?>
 /> Author</label>
					<label><input name="fields[date_column]" type="checkbox" <?php 
print General::fieldValue("checkbox", $fields["date_column"], "", 1);
?>
 /> Date Published</label>
				</div>
				<input name="action[save]" type="submit" value="Save" accesskey="s" />

			</fieldset>
		</form>
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_structure_sections_new.php

示例10: foreach

				</div>

			</fieldset>
			<fieldset>
				<legend>Formatting Options</legend>
				<label>Comment Formatting Preference
					<select name="fields[formatting-type]">
						<option>None</option>
<?php 
foreach ($formatters as $name => $about) {
    ?>
						<option value="<?php 
    print $name;
    ?>
" <?php 
    print General::fieldValue("select", $Admin->getConfigVar("formatting-type", "commenting") == $name);
    ?>
><?php 
    print $about['name'];
    ?>
</option>

<?php 
}
?>
					</select>
				</label>

			</fieldset>
			<input name="action[done]" type="submit" value="Save Changes" <?php 
print !$bIsWritable ? 'disabled="disabled"' : '';
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_publish_comments_settings.php


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