本文整理汇总了PHP中elgg_get_sticky_value函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_get_sticky_value函数的具体用法?PHP elgg_get_sticky_value怎么用?PHP elgg_get_sticky_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elgg_get_sticky_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: messages_prepare_form_vars
/**
* Prepare the compose form variables
*
* @return array
*/
function messages_prepare_form_vars($recipient_guid = 0)
{
// input names => defaults
$values = array('subject' => '', 'body' => '', 'recipient_guid' => $recipient_guid);
if (elgg_is_sticky_form('messages')) {
foreach (array_keys($values) as $field) {
$values[$field] = elgg_get_sticky_value('messages', $field);
}
}
elgg_clear_sticky_form('messages');
return $values;
}
示例2: messages_prepare_form_vars
/**
* Prepare the compose form variables
*
* @return array
*/
function messages_prepare_form_vars($recipient_guid = 0)
{
$recipient_username = '';
$recipient = get_entity($recipient_guid);
if (elgg_instanceof($recipient, 'user')) {
$recipient_username = $recipient->username;
}
// input names => defaults
$values = array('subject' => '', 'body' => '', 'recipient_username' => $recipient_username);
if (elgg_is_sticky_form('messages')) {
foreach (array_keys($values) as $field) {
$values[$field] = elgg_get_sticky_value('messages', $field);
}
}
elgg_clear_sticky_form('messages');
return $values;
}
示例3: elgg_echo
<?php
namespace Beck24\MemberSelfDelete;
$explanation = elgg_echo('member_selfdelete:explain:' . elgg_get_plugin_setting('method', PLUGIN_ID));
echo elgg_view('output/longtext', array('value' => $explanation));
if (elgg_get_plugin_setting('method', PLUGIN_ID) == "choose") {
$value = elgg_get_sticky_value('member_selfdelete', 'method', 'delete');
$options = array('name' => 'method', 'value' => $value, 'options' => array(elgg_echo('member_selfdelete:explain:anonymize') => 'anonymize', elgg_echo('member_selfdelete:explain:ban') => 'ban', elgg_echo('member_selfdelete:explain:delete') => 'delete'));
echo elgg_view('input/radio', $options);
}
if (elgg_get_plugin_setting('feedback', PLUGIN_ID) == "yes") {
echo '<div class="pvs">';
echo "<label>" . elgg_echo('member_selfdelete:label:reason') . "</label>";
echo elgg_view('input/longtext', array('name' => 'reason', 'value' => elgg_get_sticky_value('member_selfdelete', 'reason')));
echo '</div>';
}
echo '<div class="pvs">';
echo "<label>" . elgg_echo('member_selfdelete:label:confirmation') . '</label>';
echo elgg_view('input/password', array('name' => 'confirmation'));
echo '</div>';
echo '<div class="elgg-foot">';
echo elgg_view('input/submit', array('value' => elgg_echo('member_selfdelete:submit')));
echo '</div>';
elgg_clear_sticky_form('member_selfdelete');
示例4: elgg_get_sticky_value
$comments = elgg_get_sticky_value("user_support_faq", "allow_comments", "no");
$context = elgg_get_sticky_value("user_support_faq", "help_context", $entity->help_context);
if (!empty($context) && !is_array($context)) {
$context = array($context);
} elseif (empty($context)) {
$context = array();
}
$submit_text = elgg_echo("save");
} else {
$title = elgg_get_sticky_value("user_support_faq", "title");
$desc = elgg_get_sticky_value("user_support_faq", "description");
$access_id = elgg_get_sticky_value("user_support_faq", "access_id", get_default_access());
$container_guid = elgg_get_page_owner_guid();
$tags = elgg_get_sticky_value("user_support_faq", "tags", array());
$comments = elgg_get_sticky_value("user_support_faq", "allow_comments", "no");
$context = elgg_get_sticky_value("user_support_faq", "help_context", array());
$submit_text = elgg_echo("save");
}
elgg_clear_sticky_form("user_support_faq");
$form_data .= "<div>";
$form_data .= "<label>" . elgg_echo("user_support:question") . "</label>";
$form_data .= elgg_view("input/text", array("name" => "title", "value" => $title));
$form_data .= "</div>";
$form_data .= "<div>";
$form_data .= "<label>" . elgg_echo("user_support:anwser") . "</label>";
$form_data .= elgg_view("input/longtext", array("name" => "description", "value" => $desc));
$form_data .= "</div>";
$form_data .= "<div>";
$form_data .= "<label>" . elgg_echo("tags") . "<label>";
$form_data .= elgg_view("input/tags", array("name" => "tags", "value" => $tags));
$form_data .= "</div>";
示例5: elgg_echo
?>
</a>
<div class="rhs-edit-block__top"><img src="<?php
echo $poster->getIconURL("small");
?>
" class="rhs-edit-block__image">
<div href="#" title="<?php
echo elgg_echo("rijkshuisstijl:go_to_profile");
?>
" class="rhs-edit-block__name"><?php
echo $poster->name;
?>
</div>
</div>
<?php
echo elgg_view("input/longtext", array("id" => "data-forum-answer-textarea", "name" => $description_field, "value" => elgg_get_sticky_value("comment", "description", $comment->description)));
?>
<div class="rhs-edit-block__bottom rhs-form__actions">
<?php
echo elgg_view("output/url", array("class" => "rhs-button", "href" => "#", "text" => elgg_echo("rijkshuisstijl:cancel"), "data-forum-answer-close" => ""));
?>
<?php
echo elgg_view("input/submit", array("class" => "rhs-button rhs-button--primary", "value" => elgg_echo("rijkshuisstijl:answer:submit")));
?>
</div>
示例6: elgg_get_sticky_value
$title = ['name' => 'title', 'id' => 'question_title', 'value' => elgg_get_sticky_value('question', 'title', $question->title), 'required' => true];
$description = ['name' => 'description', 'id' => 'question_description', 'value' => elgg_get_sticky_value('question', 'description', $question->description)];
$tags = ['name' => 'tags', 'id' => 'question_tags', 'value' => elgg_get_sticky_value('question', 'tags', $question->tags)];
$comment_options = ['name' => 'comments_enabled', 'id' => 'questions-comments', 'value' => elgg_get_sticky_value('question', 'comments_enabled', $question->comments_enabled), 'options_values' => ['on' => elgg_echo('on'), 'off' => elgg_echo('off')], 'class' => 'mls'];
if ($container instanceof ElggUser) {
$access_setting = questions_get_personal_access_level();
if ($access_setting !== false) {
$show_access_options = false;
}
} elseif ($container instanceof ElggGroup) {
$access_setting = questions_get_group_access_level($container);
if ($access_setting !== false) {
$show_access_options = false;
}
}
$access_id = ['name' => 'access_id', 'id' => 'question_access_id', 'value' => (int) elgg_get_sticky_value('question', 'access_id', $question->access_id)];
// clear sticky form
elgg_clear_sticky_form('question');
?>
<div>
<label for='question_title'><?php
echo elgg_echo('questions:edit:question:title');
?>
</label>
<?php
echo elgg_view('input/text', $title);
?>
</div>
<div>
<label for='question_description'><?php
echo elgg_echo('questions:edit:question:description');
示例7: elgg_get_sticky_value
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*
* @uses $vars['value'] The current value, if any
* @uses $vars['js'] Any Javascript to enter into the input tag
* @uses $vars['internalname'] The name of the input field
* @uses $vars['options'] An array of strings representing the label => options for the checkbox field
*
*/
$class = $vars['class'];
if (!$class) {
$class = "input_checkboxes";
}
if (!isset($vars['value']) || $vars['value'] === FALSE) {
$vars['value'] = elgg_get_sticky_value($vars['internalname']);
}
foreach ($vars['options'] as $label => $option) {
//if (!in_array($option,$vars['value'])) {
if (is_array($vars['value'])) {
$valarray = $vars['value'];
$valarray = array_map('strtolower', $valarray);
if (!in_array(strtolower($option), $valarray)) {
$selected = "";
} else {
$selected = "checked = \"checked\"";
}
} else {
if (strtolower($option) != strtolower($vars['value'])) {
$selected = "";
} else {
示例8: elgg_view
<?php
echo elgg_view('input/file', array('name' => 'featured_photo'));
?>
<?php
}
?>
</div>
</div><br />
<div>
<label for="tags"><?php
echo elgg_echo("tags");
?>
</label><br />
<?php
echo elgg_view('input/tags', array('name' => 'tags', 'value' => elgg_get_sticky_value('news', 'tags', $entity->tags)));
?>
</div><br />
<div>
<label for="tags"><?php
echo elgg_echo("access");
?>
</label><br />
<?php
echo elgg_view('input/access', array('name' => 'access_id', 'value' => $entity->access_id ? $entity->access_id : get_default_access()));
?>
</div><br />
<?php
echo elgg_view("input/submit", array('value' => $entity ? elgg_echo('edit') : elgg_echo('add')));
示例9: elgg_get_sticky_value
<?php
/**
* Elgg groups plugin
*
* @package ElggGroups
*/
$comment = elgg_get_sticky_value('group_invite', 'comment');
elgg_clear_sticky_form('group_invite');
$group = elgg_extract("entity", $vars, elgg_get_page_owner_entity());
$invite_site_members = elgg_extract("invite", $vars, "no");
$invite_email = elgg_extract("invite_email", $vars, "no");
$invite_csv = elgg_extract("invite_csv", $vars, "no");
$owner = $group->getOwnerEntity();
$forward_url = $group->getURL();
$tabs = false;
$friends = elgg_get_logged_in_user_entity()->getFriends(array("limit" => false));
if (!empty($friends)) {
$toggle_content = "<span>" . elgg_echo("group_tools:group:invite:friends:select_all") . "</span>";
$toggle_content .= "<span class='hidden'>" . elgg_echo("group_tools:group:invite:friends:deselect_all") . "</span>";
$friendspicker = elgg_view("output/url", array("text" => $toggle_content, "href" => "javascript:void(0);", "onclick" => "group_tools_toggle_all_friends();", "id" => "friends_toggle", "class" => "float-alt elgg-button elgg-button-action"));
$friendspicker .= elgg_view('input/friendspicker', array('entities' => $friends, 'name' => 'user_guid', 'highlight' => 'all'));
} else {
$friendspicker = elgg_echo('groups:nofriendsatall');
}
// which options to show
if (in_array("yes", array($invite_site_members, $invite_email, $invite_csv))) {
$tabs = array("friends" => array("text" => elgg_echo("friends"), "href" => "#", "rel" => "friends", "priority" => 200, "onclick" => "group_tools_group_invite_switch_tab(\"friends\");", "selected" => true));
// invite friends
$form_data = "<div id='group_tools_group_invite_friends'>";
$form_data .= $friendspicker;
示例10: elgg_extract
$entity = elgg_extract("entity", $vars);
$container = $entity->getContainerEntity();
$recipients = $entity->getRecipients();
if (!empty($recipients)) {
$user_guids = elgg_get_sticky_value("newsletter_recipients", "user_guids", elgg_extract("user_guids", $recipients));
$group_guids = elgg_get_sticky_value("newsletter_recipients", "group_guids", elgg_extract("group_guids", $recipients));
$emails = elgg_get_sticky_value("newsletter_recipients", "emails", elgg_extract("emails", $recipients));
$subscribers = (int) elgg_get_sticky_value("newsletter_recipients", "subscribers", elgg_extract("subscribers", $recipients));
$members = (int) elgg_get_sticky_value("newsletter_recipients", "members", elgg_extract("members", $recipients));
} else {
$user_guids = elgg_get_sticky_value("newsletter_recipients", "user_guids");
$group_guids = elgg_get_sticky_value("newsletter_recipients", "group_guids");
$emails = elgg_get_sticky_value("newsletter_recipients", "emails");
$subscribers = (int) elgg_get_sticky_value("newsletter_recipients", "subscribers");
$members = (int) elgg_get_sticky_value("newsletter_recipients", "members");
}
elgg_load_js('jquery.ui.autocomplete.html');
elgg_require_js('newsletter/recipients');
echo "<div>";
echo elgg_view("output/longtext", array("value" => elgg_echo("newsletter:recipients:description")));
echo "</div>";
echo "<div>";
echo "<label for='newsletter-recipients-csv'>" . elgg_echo("newsletter:recipients:csv") . "</label>";
echo elgg_view("input/file", array("name" => "csv", "id" => "newsletter-recipients-csv"));
echo "<div class='elgg-subtext'>" . elgg_echo("newsletter:recipients:csv:description") . "</div>";
echo "</div>";
echo "<div>";
echo "<label for='newsletter-recipients-autocomplete'>" . elgg_echo("newsletter:recipients:recipient") . "</label>";
echo elgg_view("input/text", array("name" => "q", "id" => "newsletter-recipients-autocomplete", "class" => "elgg-input-autocomplete"));
echo "<div class='elgg-subtext'>" . elgg_echo("newsletter:recipients:recipient:description") . "</div>";
示例11: natcasesort
}
natcasesort($type_subtype_options);
$type_subtype_options = array_merge(array_reverse($type_subtype_options), array("" => elgg_echo("csv_exporter:admin:type_subtype:choose")));
$type_subtype_options = array_reverse($type_subtype_options);
$form_body = "";
$preview = "";
$type_subtype = elgg_get_sticky_value("csv_exporter", "type_subtype", get_input("type_subtype"));
$form_body .= "<div>";
$form_body .= "<label for='csv-exporter-type-subtype'>" . elgg_echo("csv_exporter:admin:type_subtype") . "</label>";
$form_body .= elgg_view("input/dropdown", array("name" => "type_subtype", "value" => $type_subtype, "options_values" => $type_subtype_options, "id" => "csv-exporter-type-subtype", "class" => "mls"));
$form_body .= "</div>";
if (!empty($type_subtype)) {
list($type, $subtype) = explode(":", $type_subtype);
$exportable_values_options = csv_exporter_get_exportable_values($type, $subtype, true);
uksort($exportable_values_options, "strcasecmp");
$exportable_values = elgg_get_sticky_value("csv_exporter", "exportable_values", get_input("exportable_values"));
$form_body .= "<div>";
$form_body .= elgg_echo("csv_exporter:admin:exportable_values") . "<br />";
$form_body .= elgg_view("input/checkboxes", array("name" => "exportable_values", "options" => $exportable_values_options, "value" => $exportable_values));
$form_body .= "</div>";
$form_body .= "<div class='elgg-foot'>";
$form_body .= elgg_view("input/button", array("value" => elgg_echo("csv_exporter:admin:download"), "class" => "elgg-button-action float-alt", "id" => "csv-exporter-download"));
$form_body .= elgg_view("input/submit", array("value" => elgg_echo("csv_exporter:admin:preview")));
$form_body .= "</div>";
if (!empty($exportable_values)) {
$preview = elgg_view("csv_exporter/preview", array("type" => $type, "subtype" => $subtype, "exportable_values" => $exportable_values));
}
} else {
$form_body .= elgg_view("output/longtext", array("value" => elgg_echo("csv_exporter:admin:exportable_values:choose")));
}
elgg_clear_sticky_form("csv_exporter");
示例12: elgg_view_input
$content_access_id = $parent->access_id;
}
}
}
// build the form
$form_body = elgg_view_input('text', ['label' => elgg_echo('title'), 'name' => 'title', 'value' => elgg_get_sticky_value('static', 'title', $content_title), 'required' => true]);
if (!empty($entity)) {
$form_body .= elgg_view_input('text', ['label' => elgg_echo('static:new:permalink'), 'name' => 'friendly_title', 'value' => elgg_get_sticky_value('static', 'friendly_title', $friendly_title), 'required' => true]);
}
$form_body .= '<div class="mbm"><label>' . elgg_echo('static:new:thumbnail') . '</label><br />';
$form_body .= elgg_view('input/file', ['name' => 'thumbnail']);
if ($entity && $entity->icontime) {
$form_body .= elgg_view('input/checkbox', ['name' => 'remove_thumbnail', 'value' => '1', 'label' => elgg_echo('static:new:remove_thumbnail')]);
}
$form_body .= '</div>';
$form_body .= elgg_view_input('longtext', ['label' => elgg_echo('description'), 'name' => 'description', 'value' => elgg_get_sticky_value('static', 'description', $content_description), 'required' => true]);
$form_body .= elgg_view_input('static/parent', ['label' => elgg_echo('static:new:parent'), 'name' => 'parent_guid', 'value' => elgg_get_sticky_value('static', 'parent_guid', $parent_guid), 'owner' => $owner, 'entity' => $entity]);
$form_body .= elgg_view_input('select', ['label' => elgg_echo('static:new:comment'), 'name' => 'enable_comments', 'value' => elgg_get_sticky_value('static', 'enable_comments', $content_enable_comments), 'options_values' => $comment_options]);
$form_body .= elgg_view_input('userpicker', ['label' => elgg_echo('static:new:moderators'), 'name' => 'moderators', 'values' => elgg_get_sticky_value('static', 'moderators', $content_moderators)]);
$form_body .= elgg_view_input('access', ['label' => elgg_echo('access'), 'name' => 'access_id', 'value' => elgg_get_sticky_value('static', 'access_id', $content_access_id)]);
$form_body .= '<div class="elgg-foot mtm">';
$form_body .= elgg_view('input/hidden', ['name' => 'guid', 'value' => $content_guid]);
$form_body .= elgg_view('input/hidden', ['name' => 'owner_guid', 'value' => $content_owner_guid]);
if ($entity) {
$form_body .= elgg_view('output/url', ['href' => 'action/static/delete?guid=' . $entity->getGUID(), 'text' => elgg_echo('delete'), 'class' => 'elgg-button elgg-button-delete float-alt', 'confirm' => true]);
}
$form_body .= elgg_view('input/submit', ['value' => elgg_echo('save')]);
$form_body .= '</div>';
echo $form_body;
// clear sticky form
elgg_clear_sticky_form('static');
示例13: elgg_echo
<div>
<label for="description"><?php
echo elgg_echo("theme_ffd:cafe:description");
?>
</label>
<?php
echo elgg_view('input/longtext', array('name' => 'description', 'value' => elgg_get_sticky_value('cafe', 'description', $cafe->description)));
?>
</div>
<div>
<label for="tags"><?php
echo elgg_echo("tags");
?>
</label>
<?php
echo elgg_view('input/tags', array('name' => 'tags', 'value' => elgg_get_sticky_value('cafe', 'tags', $cafe->tags), 'required' => true));
?>
</div>
<div class="theme-ffd-buttons">
<?php
echo elgg_view("input/submit", array('value' => elgg_echo('theme_ffd:cafe:publish')));
echo elgg_view("output/url", array('href' => '#', 'text' => elgg_echo('theme_ffd:cafe:cancel'), 'class' => 'elgg-button elgg-button-submit theme-ffd-collapse-control', 'style' => 'display:none'));
?>
</div>
<?php
if ($collapsable) {
?>
</div><?php
}
示例14: elgg_echo
<?php
if (!empty($_SESSION["subsite_manager_csv"])) {
echo "<div>" . elgg_echo("subsite_manager:invite:csv:description") . "</div>";
echo "<br />";
$form_vars = array("class" => "elgg-form-settings");
$body_vars = array("message" => elgg_get_sticky_value("subsite_manager_invite", "message", ""), "column" => elgg_extract("column", $_SESSION["subsite_manager_csv"]));
echo elgg_view_form("subsites/invite/csv", $form_vars, $body_vars);
} else {
forward("admin/users/invite");
}
示例15: hj_inbox_prepare_form_vars
/**
* Prepare compose form variables
*
* @param integer $recipient_guids GUIDs of recipients if any
* @param string $message_type Type of the message being composed
* @param ElggObject $entity Message to which the reply is to be sent
* @return array An array of form variables
*/
function hj_inbox_prepare_form_vars($recipient_guids = null, $message_type = HYPEINBOX_PRIVATE, $entity = null)
{
if ($recipient_guids && !is_array($recipient_guids)) {
$recipient_guids = array($recipient_guids);
}
$values = array('subject' => $entity ? "Re: {$entity->title}" : '', 'body' => '', 'recipient_guids' => $recipient_guids, 'message_type' => $message_type, 'reply_to' => $entity->guid);
if (elgg_is_sticky_form('messages')) {
foreach (array_keys($values) as $field) {
$values[$field] = elgg_get_sticky_value('messages', $field);
}
}
elgg_clear_sticky_form('messages');
return $values;
}