' . $draft_warning . '';
}
$delete_link = '';
$preview_button = '';
if ($vars['guid']) {
// add a delete button if editing
$delete_url = "action/blog/delete?guid={$vars['guid']}";
$delete_link = elgg_view('output/url', array(
'href' => $delete_url,
'text' => elgg_echo('delete'),
'class' => 'elgg-button elgg-button-delete float-alt',
'confirm' => elgg_echo('deleteconfirm')
));
}
// published blogs do not get the preview button
if (!$vars['guid'] || ($blog && $blog->status != 'published')) {
$preview_button = elgg_view('input/submit', array(
'value' => elgg_echo('preview'),
'name' => 'preview',
'class' => 'mls elgg-button-action',
));
}
$icon_remove_input = "";
if ($vars["guid"]) {
$icon_label = elgg_echo("blog_tools:label:icon:exists");
if ($blog->icontime) {
$icon_remove_input = "
";
$icon_remove_input .= "
";
$icon_remove_input .= elgg_view("input/checkbox", array(
"name" => "remove_icon",
"value" => "yes"
));
$icon_remove_input .= elgg_echo("blog_tools:label:icon:remove");
}
} else {
$icon_label = elgg_echo("blog_tools:label:icon:new");
}
if ($vars['guid']) {
$entity = get_entity($vars['guid']);
$saved = date('F j, Y @ H:i', $entity->time_created);
} else {
$saved = elgg_echo('never');
}
// publication options
$status = "
";
$status .= "";
$status .= elgg_view('input/dropdown', array(
'name' => 'status',
'id' => 'blog_status',
'value' => $vars['status'],
'options_values' => array(
'draft' => elgg_echo('status:draft'),
'published' => elgg_echo('status:published')
),
'class' => 'mls'
));
$status .= "
";
// advanced publication options
if (blog_tools_use_advanced_publication_options()) {
if (!empty($blog)) {
$publication_date_value = elgg_extract("publication_date", $vars, $blog->publication_date);
$expiration_date_value = elgg_extract("expiration_date", $vars, $blog->expiration_date);
} else {
$publication_date_value = elgg_extract("publication_date", $vars);
$expiration_date_value = elgg_extract("expiration_date", $vars);
}
if (empty($publication_date_value)) {
$publication_date_value = "";
}
if (empty($expiration_date_value)) {
$expiration_date_value = "";
}
$publication_date = "";
$publication_date .= "
";
$publication_date .= elgg_view("input/date", array(
"name" => "publication_date",
"value" => $publication_date_value));
$publication_date .= "
" . elgg_echo("blog_tools:publication_date:description") . "
";
$publication_date .= "
";
$expiration_date = "";
$expiration_date .= "
";
$expiration_date .= elgg_view("input/date", array(
"name" => "expiration_date",
"value" => $expiration_date_value));
$expiration_date .= "
" . elgg_echo("blog_tools:expiration_date:description") . "
";
$expiration_date .= "
";
$publication_options = elgg_view_module("info", elgg_echo("blog_tools:label:publication_options"), $status . $publication_date . $expiration_date);
} else {
$publication_options = $status;
}
// show owner
$show_owner_setting = elgg_get_plugin_setting("show_full_owner", "blog_tools");
if (empty($show_owner_setting)) {
$show_owner_setting = "no";
}
if (empty($blog)) {
$show_owner_value = elgg_extract("show_owner", $vars, $show_owner_setting);
} else {
$show_owner_value = elgg_extract("show_owner", $vars, $blog->show_owner);
}
if ($show_owner_setting == "optional") {
$show_owner_input = elgg_view('input/dropdown', array(
'name' => 'show_owner',
'id' => 'blog_show_owner',
'class' => 'mls',
'value' => $show_owner_value,
'options_values' => array('no' => elgg_echo('option:no'), 'yes' => elgg_echo('option:yes'))
));
} else {
$show_owner_input = elgg_view('input/hidden', array(
'name' => 'show_owner',
'id' => 'blog_show_owner',
'value' => $show_owner_value,
));
}
// start drawing the form
echo $draft_warning;
// title
echo "";
echo "";
echo elgg_view('input/text', array('name' => 'title', 'id' => 'blog_title', 'value' => $vars['title']));
echo "
";
// exerpt
echo "";
echo "";
echo elgg_view('input/text', array('name' => 'excerpt', 'id' => 'blog_excerpt', 'value' => _elgg_html_decode($vars['excerpt'])));
echo "
";
// icon
echo "";
echo "";
echo elgg_view("input/file", array("name" => "icon", "id" => "blog_icon"));
echo $icon_remove_input;
echo "
";
// the blog content
echo "";
echo "";
echo elgg_view('input/longtext', array('name' => 'description', 'id' => 'blog_description', 'value' => $vars['description']));
echo "
";
// tags
echo "";
echo "";
echo elgg_view('input/tags', array('name' => 'tags', 'id' => 'blog_tags', 'value' => $vars['tags']));
echo "
";
// categories
echo elgg_view('input/categories', $vars);
// comments
echo "";
echo "";
echo elgg_view('input/dropdown', array(
'name' => 'comments_on',
'id' => 'blog_comments_on',
'class' => 'mls',
'value' => $vars['comments_on'],
'options_values' => array(
'On' => elgg_echo('on'),
'Off' => elgg_echo('off')
)
));
echo "
";
// show owner information
if ($show_owner_setting == "optional") {
echo "";
echo "";
echo $show_owner_input;
echo "
";
} else {
echo $show_owner_input;
}
// access
echo "";
echo "";
echo elgg_view('input/access', array('name' => 'access_id', 'id' => 'blog_access_id', 'class' => 'mls', 'value' => $vars['access_id']));
echo "
";
// advanced publication options
echo $publication_options;
// buttons and hidden inputs
echo "";