<?php
defined('_JEXEC') or die('Restricted access');
//print_r($this->sections);
$config=$this->config;
?>
<style>
div.header 
{
	padding-left: 0;
}
</style>
<link rel="stylesheet" href="components/com_allarticleannounce/js/style.css" type="text/css" />
<script type="text/javascript" src="components/com_allarticleannounce/js/ajax.js"></script>
<table width="100%"  border="0" cellspacing="4" cellpadding="6">
	<tr>
	
		<!-- side menu -->

		<td width="15%" valign="top" align="center">
			
			<div style="background-color:#F8F8F8" id="sideNav"><div class="t"><div class="t"><div class="t"></div></div></div><div class="m" style='padding:0;height:530px;'>				
				<table width="100%"  border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>
						<div>
							<span title='If you require assistance with the installation or use of this product: '>
								<h3 align='left' style='position:relative; left:10px;'>Setting</h3>
							</span>
							<ul style="position:relative;left:-10px;">
								<li>
									Global Configuration
								</li>
								<li>
									<a href="index.php?option=com_allarticleannounce&task=history" title="History Link">History</a>
								</li>
							</ul>
							<span title='If you require assistance with the installation or use of this product: '>
								<h3 align='left' style='position:relative; left:10px;'>Joomtraders Support</h3>
							</span>
							<ul style="position:relative;left:-10px;">
							<li> <a href="http://www.joomtraders.com/forum.html" target="_blank" title="External link to Our Forums">Our forums</a>
							</li><li><a href="mailto:support@joomtraders.com" target="_blank" title="Email Link">Email Support</a>
							</li><li><a href="http://www.joomtraders.com/tickets.html" target="_blank" title="Log a ticket">Log a ticket</a>
							</li>
							</ul>
						</div>														
					</td>											
				</tr>
			  </table>
			</div><div class="b"><div class="b"><div class="b"></div></div></div></div>
		</td>	
		
		
		<!-- right part -->
		<td style='vertical-align:top;'>
			<!-- short instruction -->
			<div style="background-color:#F8F8F8"><div class="t"><div class="t"><div class="t"></div></div></div><div class="m">				
				<h3>Instruction</h3>
				<p>
				Thank you for installing allArticleAnnounce from <a href="http://www.joomtraders.com" title="External link to Joomtraders" target="_blank">Joomtraders</a>.
				</p>
			</div><div class="b"><div class="b"><div class="b"></div></div></div></div>
			<div style='height:10px;'></div>
			
			<!-- control panel -->
			<div style="background-color:#F8F8F8"><div class="t"><div class="t"><div class="t"></div></div></div><div class="m">				
			<!-- mail list imformation-->
				<form action="index.php" method="post" name="adminForm">
					<fieldset>
						<legend><?php echo JText::_( 'Global Configuration' ); ?></legend>
							<table style="text-align:left;text-valign:top;" cellpadding='3'>
								<tr>
									<td colspan=2>
										<h3>Facebook</h3>
									</td>
								</tr>
								<tr>
									<td width='450'>
										<table style="text-align:left;text-valign:top;" cellpadding='3'>
											<tr>
												<td width="200">
													<img src="components/com_allarticleannounce/image/notice.png" title="Publish the article to the Facebook" style="width:20px;height:20px;"/>&nbsp;&nbsp;Enable Facebook Updates:
												</td>
												<td>
													<input name="publish_facebook" type="radio" value='1' <?php echo ($config->publish_facebook=='1')?'checked':'';?>/>Yes&nbsp;&nbsp;&nbsp;
													<input name="publish_facebook" type="radio" value='0' <?php echo ($config->publish_facebook=='0')?'checked':'';?>/>No
												</td>
											</tr>
											<tr>
												<td width="200">
													<img src="components/com_allarticleannounce/image/notice.png" title="The username email for Facebook account." style="width:20px;height:20px;"/>&nbsp;&nbsp;Facebook Account Email:
												</td>
												<td>
													<input type='text' name='username_f' size='60' value='<?php echo $config->username_f;?>'/>
												</td>
											</tr>
											<tr>
												<td width="200">
													<img src="components/com_allarticleannounce/image/notice.png" title="The password of the Facebook account." style="width:20px;height:20px;"/>&nbsp;&nbsp;Facebook Account Password:
												</td>
												<td>
													<input type='password' name='ps_f' size='60' value='<?php echo $config->ps_f;?>'/>
												</td>
											</tr>
											<tr>
												<td width="200">
													<img src="components/com_allarticleannounce/image/notice.png" title="Publish The Article To Personal Wall or Business Page." style="width:20px;height:20px;"/>&nbsp;&nbsp;Publish The Article To:
												</td>
												<td>
													<input name="page_type" type="radio" value='1' <?php echo ($config->page_type=='1')?'checked':'';?>/>Personal Profile&nbsp;&nbsp;&nbsp;
													<input name="page_type" type="radio" value='0' <?php echo ($config->page_type=='0')?'checked':'';?>/>Business Page
												</td>
											</tr>
											<tr>
												<td width="200">
													<img src="components/com_allarticleannounce/image/notice.png" title="Facebook Business Page ID." style="width:20px;height:20px;"/>&nbsp;&nbsp;Business Page ID:
												</td>
												<td>
													<input type='text' name='page_id' size='60' value='<?php echo $config->page_id;?>'/>
												</td>
											</tr>
										</table>
									</td>
									<td width='450'>
										<table style="text-align:left;text-valign:top;" cellpadding='3'>
											<tr>
												<td width="100">
													<img src="components/com_allarticleannounce/image/notice.png" title="Only publish articles belong to the selected category." style="width:20px;height:20px;"/>&nbsp;&nbsp;Categories:
												</td>
												<td>
													<input type="radio" name='all_categories_f' value='1' <?php echo ($config->all_categories_f=='1')?'checked':'';?> onclick="set_category_option('disabled','f')"/>All Category
													<input type="radio" name='all_categories_f' value='0' <?php echo ($config->all_categories_f=='0')?'checked':'';?> onclick="set_category_option('','f')"/>Selected
													<br/>
													<?php 
														$size=count($this->categories);
														$size=($size>=15)?15:$size;
													?>
													<select id='category_option_f' multiple="multiple" size="<?php echo $size;?>" name="category_option_f[]" <?php echo ($config->all_categories_f=='1')?'disabled':'';?>>
													<?php
													foreach($this->categories as $category)
													{
														$categories=explode(',',$config->category_option_f);
														$true=false;
														foreach($categories as $cat)
														{
															if($cat==$category->id)
															{
																$true=true;
															}
														}
													?>
														<option value='<?php echo $category->id;?>' <?php echo ($true)?'selected':'';?>><?php echo $category->title;?></option>
													<?php
													}
													?>
													</select>
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td colspan=2>
										<h3>Twitter</h3>
									</td>
								</tr>
								<tr>
									<td>
										<table style="text-align:left;text-valign:top;" cellpadding='3'>
											<tr>
												<td width="200">
													<img src="components/com_allarticleannounce/image/notice.png" title="Publish the article to the Twitter." style="width:20px;height:20px;"/>&nbsp;&nbsp;Enable Twitter Updates:
												</td>
												<td>
													<input name="publish_twitter" type="radio" value='1' <?php echo ($config->publish_twitter=='1')?'checked':'';?>/>Yes&nbsp;&nbsp;&nbsp;
													<input name="publish_twitter" type="radio" value='0' <?php echo ($config->publish_twitter=='0')?'checked':'';?>/>No
												</td>
											</tr>
											<tr>
												<td width="200">
													<img src="components/com_allarticleannounce/image/notice.png" title="The username account of the twitter." style="width:20px;height:20px;"/>&nbsp;&nbsp;Twitter Account Username:
												</td>
												<td>
													<input type='text' name='username_t' size='60' value='<?php echo $config->username_t;?>'/>
												</td>
											</tr>
											<tr>
												<td width="200">
													<img src="components/com_allarticleannounce/image/notice.png" title="The password of the twitter account." style="width:20px;height:20px;"/>&nbsp;&nbsp;Twitter Account Password:
												</td>
												<td>
													<input type='password' name='ps_t' size='60' value='<?php echo $config->ps_t;?>'/>
												</td>
											</tr>
										</table>
									</td>
									<td>
										<table style="text-align:left;text-valign:top;" cellpadding='3'>
											<tr>
												<td width="100">
													<img src="components/com_allarticleannounce/image/notice.png" title="Only publish articles belong to the selected category." style="width:20px;height:20px;"/>&nbsp;&nbsp;Categories:
												</td>
												<td>
													<input type="radio" name='all_categories_t' value='1' <?php echo ($config->all_categories_t=='1')?'checked':'';?> onclick="set_category_option('disabled','t')"/>All Category
													<input type="radio" name='all_categories_t' value='0' <?php echo ($config->all_categories_t=='0')?'checked':'';?> onclick="set_category_option('','t')"/>Selected
													<br/>
													<?php 
														$size=count($this->categories);
														$size=($size>=15)?15:$size;
													?>
													<select id='category_option_t' multiple="multiple" size="<?php echo $size;?>" name="category_option_t[]" <?php echo ($config->all_categories_t=='1')?'disabled':'';?>>
													<?php
													foreach($this->categories as $category)
													{
														$categories=explode(',',$config->category_option_t);
														$true=false;
														foreach($categories as $cat)
														{
															if($cat==$category->id)
															{
																$true=true;
															}
														}
													?>
														<option value='<?php echo $category->id;?>' <?php echo ($true)?'selected':'';?>><?php echo $category->title;?></option>
													<?php
													}
													?>
													</select>
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td colspan=2>
										<h3>System</h3>
									</td>
								</tr>
								<tr>
									<td width='450'>
										<table style="text-align:left;text-valign:top;" cellpadding='3'>
											<tr>
												<td width="200">
												<img src="components/com_allarticleannounce/image/notice.png" title="Display the update message." style="width:20px;height:20px;"/>&nbsp;&nbsp;Display Update Message:
												</td>
												<td>
													<input name="update_message" type="radio" value='1' <?php echo ($config->update_message=='1')?'checked':'';?>/>Yes&nbsp;&nbsp;&nbsp;
													<input name="update_message" type="radio" value='0' <?php echo ($config->update_message=='0')?'checked':'';?>/>No
												</td>
											</tr>
											<tr>
												<td width="200">
												<img src="components/com_allarticleannounce/image/notice.png" title="Content Type" style="width:20px;height:20px;"/>&nbsp;&nbsp;Content Type:
												</td>
												<td>
													<input name="content_type" type="radio" value='0' <?php echo ($config->content_type=='0')?'checked':'';?>/>First 80 Characters <br/>
													<input name="content_type" type="radio" value='1' <?php echo ($config->content_type=='1')?'checked':'';?>/>Metadata Description
												</td>
											</tr>
											<tr>
												<td width="200">
												<img src="components/com_allarticleannounce/image/notice.png" title="Internet Connection Timeout" style="width:20px;height:20px;"/>&nbsp;&nbsp;Connection Timeout:
												</td>
												<td>
													<input name="timeout" type="text" size='5' value='<?php echo $config->timeout;?>'/>&nbsp;Seconds
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td colspan='2' align="center">
										<input type='submit' value='Save the values' style="cursor:pointer"/>
									</td>
								</tr>
							</table>
					</fieldset>
				<input type="hidden" name="option" value="com_allarticleannounce" />
				<input type="hidden" name="task" value="save" />
				<input type="hidden" name="boxchecked" value="0" />
				<?php echo JHTML::_( 'form.token' ); ?>	
				</form>
			
			</div><div class="b"><div class="b"><div class="b"></div></div></div></div>
			<div style='height:10px;'></div>
		</td>	
	</tr>
</table>