Files
friendshiptours.org/site/en/admin/linksandnumbers.add.edit.php
2015-11-12 19:58:50 -06:00

75 lines
3.2 KiB
PHP

<h2>Administrate FTI: Links and Numbers</h2>
<p>
<?php if(isset($this->data['editing'])): ?>
Edit the links and numbers item below and click on "Save item" at the bottom
of the page when you are done.
<?php else: ?>
Add a links and numbers item to the links and numbers page by filling out the form below.
<?php endif; ?>
</p>
<p>
You make bold and italics text by selecting the text that you want to make
bold or italics inside the "News text" box and clicking either the bold (b)
button or the italics (i) button on the top right of the news box.
</p>
<p>
Similarly, select any text that you want to make a link and click on
the link button. A window will pop up and prompt you for the URL
that you would like that text to link to.
</p>
<p>
You can create two types of Links and Numbers items: Pages and External links.
To create an External link, select that option from the "Type" list, enter
a title for the link and put the URL for the link (only the URL) in the "Text"
box.
</p>
<p>
To create a regular Page, select that option for the "Type" list, enter a
title that will appear on the Links and Numbers page and put the
text for the page in the "Text" page.
</p>
<div class='admin_summary_box'>
<h3><?php echo isset($this->data['editing']) ? 'Edit' : 'Add' ?> Links and Numbers Item</h3>
<form action="linksandnumbers.php" method="post" id='linksandnumbers_form' accept-charset="utf-8">
<input type="hidden" name="do" value="really<?php echo isset($this->data['item']) ? 'edit' : 'add' ?>" id="do"/>
<?php if(isset($this->data['editing'])): ?>
<input type='hidden' name='id' value='<?php echo $this->data['item']['id'] ?>' id='id'/>
<?php endif; ?>
<p class='field'>
<label for='title'>Title</label>
<input type="text" name="title"
value="<?php echo isset($this->data['editing']) ? htmlspecialchars($this->data['item']->title) : '' ?>"
id="title" class='long' />
</p>
<p class='field'>
<label for='subtitle'>Subtitle</label>
<input type="text" name="subtitle"
value="<?php echo isset($this->data['editing']) ? htmlspecialchars($this->data['item']->subtitle) : '' ?>"
id="subtitle" class='long' />
</p>
<p class='field'>
<label for='type'>Type</label>
<select name='type' id='type'>
<?php
foreach(array('External link','Page') as $type):
$xmlType = strtolower(str_replace(' ','_',$type));
if(isset($this->data['editing']) && $xmlType == (string)$this->data['item']->type):
echo "<option value='$xmlType' selected='selected'>".$type."</option>";
else:
echo "<option value='$xmlType'>".$type."</option>";
endif;
endforeach;
?>
</select>
</p>
<p class='field'>
<label for='text'>Links and numbers text</label>
<?php include 'textboxbuttons.php' ?>
<textarea id='text' name='text'><?php
echo isset($this->data['editing']) ? preg_replace("#<!\[\CDATA\[(.*)]]>#","$1",(string)$this->data['item']->text) : ''
?></textarea>
</p>
<p><input type="submit" value="<?php echo isset($this->data['editing']) ? 'Save' : 'Add' ?> item"></p>
</form>
</div>