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

43 lines
1.8 KiB
PHP

<h2>Administrate FTI: News</h2>
<p>
<?php if(isset($this->data['editing'])): ?>
Edit the news post below and click on "Save news item" at the bottom
of the page when you are done.
<?php else: ?>
Add a news post to the front 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>
<div class='admin_summary_box'>
<h3><?php echo isset($this->data['editing']) ? 'Edit' : 'Add' ?> News Item</h3>
<form action="news.php" method="post" id='news_form' accept-charset="utf-8">
<input type="hidden" name="do" value="really<?php echo isset($this->data['newsitem']) ? 'edit' : 'add' ?>" id="do"/>
<?php if(isset($this->data['editing'])): ?>
<input type='hidden' name='id' value='<?php echo $this->data['newsitem']['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['newsitem']->title) : '' ?>"
id="title" class='long' />
</p>
<p class='field'>
<label for='text'>News text</label>
<?php include 'textboxbuttons.php' ?>
<textarea id='text' name='text'><?php
echo isset($this->data['editing']) ? preg_replace("#<!\[\CDATA\[(.*)]]>#","$1",(string)$this->data['newsitem']->text) : ''
?></textarea>
</p>
<p><input type="submit" value="<?php echo isset($this->data['editing']) ? 'Save' : 'Add' ?> news item"></p>
</form>
</div>