mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
* renamed twig templates to .twig, so IDE's can correctly render it
* moved news.add to twig template * now twig templates will be loaded directly from template dir f.e. templates/kathrine/news.html.twig
This commit is contained in:
parent
0e185c8bcf
commit
4685c7b868
@ -22,14 +22,14 @@ $config_salt_enabled = fieldExist('salt', 'accounts');
|
||||
if(!$logged)
|
||||
{
|
||||
if($action == "logout") {
|
||||
echo $twig->render('account.logout.html');
|
||||
echo $twig->render('account.logout.html.twig');
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!empty($errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
echo $twig->render('account.login.html', array(
|
||||
echo $twig->render('account.login.html.twig', array(
|
||||
'redirect' => isset($_REQUEST['redirect']) ? $_REQUEST['redirect'] : null,
|
||||
'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number',
|
||||
'error' => isset($errors[0]) ? $errors[0] : null
|
||||
@ -42,7 +42,7 @@ if(!$logged)
|
||||
{
|
||||
$redirect = urldecode($_REQUEST['redirect']);
|
||||
|
||||
echo $twig->render('account.redirect.html', array(
|
||||
echo $twig->render('account.redirect.html.twig', array(
|
||||
'redirect' => $redirect
|
||||
));
|
||||
return;
|
||||
@ -116,7 +116,7 @@ if(!$logged)
|
||||
);
|
||||
}
|
||||
|
||||
echo $twig->render('account.management.html', array(
|
||||
echo $twig->render('account.management.html.twig', array(
|
||||
'welcome_message' => $welcome_message,
|
||||
'recovery_key' => $recovery_key,
|
||||
'email_change' => $email_change,
|
||||
@ -141,7 +141,7 @@ if(!$logged)
|
||||
$new_password2 = isset($_POST['newpassword2']) ? $_POST['newpassword2'] : NULL;
|
||||
$old_password = isset($_POST['oldpassword']) ? $_POST['oldpassword'] : NULL;
|
||||
if(empty($new_password) && empty($new_password2) && empty($old_password)) {
|
||||
echo $twig->render('account.change_password.html');
|
||||
echo $twig->render('account.change_password.html.twig');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -170,10 +170,10 @@ if(!$logged)
|
||||
}
|
||||
if(!empty($show_msgs)){
|
||||
//show errors
|
||||
echo $twig->render('error_box.html', array('errors' => $show_msg));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $show_msg));
|
||||
|
||||
//show form
|
||||
echo $twig->render('account.change_password.html');
|
||||
echo $twig->render('account.change_password.html.twig');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -194,7 +194,7 @@ if(!$logged)
|
||||
$message = '';
|
||||
if($config['mail_enabled'] && $config['send_mail_when_change_password'])
|
||||
{
|
||||
$mailBody = $twig->render('mail.password_changed.html', array(
|
||||
$mailBody = $twig->render('mail.password_changed.html.twig', array(
|
||||
'config' => $config,
|
||||
'new_password' => $org_pass
|
||||
));
|
||||
@ -205,7 +205,7 @@ if(!$logged)
|
||||
$message = '<br/><p class="error">An error occorred while sending email with password:<br/>' . $mailer->ErrorInfo . '</p>';
|
||||
}
|
||||
|
||||
echo $twig->render('success.html', array(
|
||||
echo $twig->render('success.html.twig', array(
|
||||
'title' => 'Password Changed',
|
||||
'description' => 'Your password has been changed.' . $message
|
||||
));
|
||||
@ -250,17 +250,17 @@ if(!$logged)
|
||||
else
|
||||
{
|
||||
//show errors
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
//show form
|
||||
echo $twig->render('account.change_mail.html', array(
|
||||
echo $twig->render('account.change_mail.html.twig', array(
|
||||
'new_email' => isset($_POST['new_email']) ? $_POST['new_email'] : null
|
||||
));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $twig->render('account.change_mail.html', array(
|
||||
echo $twig->render('account.change_mail.html.twig', array(
|
||||
'new_email' => isset($_POST['new_email']) ? $_POST['new_email'] : null
|
||||
));
|
||||
}
|
||||
@ -275,7 +275,7 @@ if(!$logged)
|
||||
$account_logged->save();
|
||||
$account_logged->logAction('Account email changed to <b>' . $email_new . '</b>');
|
||||
|
||||
echo $twig->render('success.html', array(
|
||||
echo $twig->render('success.html.twig', array(
|
||||
'title' => 'Email Address Change Accepted',
|
||||
'description' => 'You have accepted <b>' . $account_logged->getEmail() . '</b> as your new email adress.'
|
||||
));
|
||||
@ -315,14 +315,14 @@ if(!$logged)
|
||||
$account_logged->setCustomField("location", $new_location);
|
||||
$account_logged->setCustomField("country", $new_country);
|
||||
$account_logged->logAction('Changed Real Name to ' . $new_rlname . ', Location to ' . $new_location . ' and Country to ' . $config['countries'][$new_country] . '.');
|
||||
echo $twig->render('success.html', array(
|
||||
echo $twig->render('success.html.twig', array(
|
||||
'title' => 'Public Information Changed',
|
||||
'description' => 'Your public information has been changed.'
|
||||
));
|
||||
$show_form = false;
|
||||
}
|
||||
else {
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ if(!$logged)
|
||||
foreach ($config['countries'] as $code => $country)
|
||||
$countries[$code] = $country;
|
||||
|
||||
echo $twig->render('account.change_info.html', array(
|
||||
echo $twig->render('account.change_info.html.twig', array(
|
||||
'countries' => $countries,
|
||||
'account_rlname' => $account_rlname,
|
||||
'account_location' => $account_location,
|
||||
@ -390,11 +390,11 @@ if(!$logged)
|
||||
if(!empty($reg_errors))
|
||||
{
|
||||
//show errors
|
||||
echo $twig->render('error_box.html', array('errors' => $reg_errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $reg_errors));
|
||||
}
|
||||
|
||||
//show form
|
||||
echo $twig->render('account.register.html');
|
||||
echo $twig->render('account.register.html.twig');
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ if(!$logged)
|
||||
{
|
||||
//show errors if not empty
|
||||
if(!empty($reg_errors)) {
|
||||
echo $twig->render('error_box.html', array('errors' => $reg_errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $reg_errors));
|
||||
}
|
||||
//show form
|
||||
echo 'To generate NEW recovery key for your account please enter your password.<br/><font color="red"><b>New recovery key cost '.$config['generate_new_reckey_price'].' Premium Points.</font> You have '.$points.' premium points. You will receive e-mail with this recovery key.</b><br/><form action="?subtopic=accountmanagement&action=newreckey" method="post" ><input type="hidden" name="registeraccountsave" value="1"><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Generate recovery key</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Password:</td><td><input type="password" name="reg_password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$template_path.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
|
||||
@ -549,7 +549,7 @@ if(!$logged)
|
||||
$player->save();
|
||||
$account_logged->setCustomField("premium_points", $points - $config['account_change_character_name_points']);
|
||||
$account_logged->logAction('Changed name from <b>' . $old_name . '</b> to <b>' . $player->getName() . '</b>.');
|
||||
echo $twig->render('success.html', array(
|
||||
echo $twig->render('success.html.twig', array(
|
||||
'title' => 'Character Name Changed',
|
||||
'description' => 'The character <b>'.$old_name.'</b> name has been changed to <b>' . $player->getName() . '</b>.'
|
||||
));
|
||||
@ -567,7 +567,7 @@ if(!$logged)
|
||||
|
||||
if(!$name_changed) {
|
||||
if(!empty($errors)) {
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
echo 'To change a name of character select player and choose a new name.<br/>
|
||||
<font color="red">Change name cost ' . $config['account_change_character_name_points'] . ' premium points. You have ' . $points . ' premium points.</font><br/><br/><form action="?subtopic=accountmanagement&action=changename" method="post" ><input type="hidden" name="changenamesave" value="1"><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Change Name</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" >
|
||||
@ -645,7 +645,7 @@ if(!$logged)
|
||||
$player->save();
|
||||
$account_logged->setCustomField("premium_points", $points - $config['account_change_character_name_points']);
|
||||
$account_logged->logAction('Changed sex on character <b>' . $player->getName() . '</b> from <b>' . $old_sex_str . '</b> to <b>' . $new_sex_str . '</b>.');
|
||||
echo $twig->render('success.html', array(
|
||||
echo $twig->render('success.html.twig', array(
|
||||
'title' => 'Character Sex Changed',
|
||||
'description' => 'The character <b>' . $player->getName() . '</b> sex has been changed to <b>' . $new_sex_str . '</b>.'
|
||||
));
|
||||
@ -663,9 +663,9 @@ if(!$logged)
|
||||
|
||||
if(!$sex_changed) {
|
||||
if(!empty($errors)) {
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
echo $twig->render('account.change_sex.html', array(
|
||||
echo $twig->render('account.change_sex.html.twig', array(
|
||||
'config' => $config,
|
||||
'players' => $account_logged->getPlayersList(),
|
||||
'player_sex' => isset($player) ? $player->getSex() : -1,
|
||||
@ -698,7 +698,7 @@ if(!$logged)
|
||||
else
|
||||
$player->setCustomField('deleted', 1);
|
||||
$account_logged->logAction('Deleted character <b>' . $player->getName() . '</b>.');
|
||||
echo $twig->render('success.html', array(
|
||||
echo $twig->render('success.html.twig', array(
|
||||
'title' => 'Character Deleted',
|
||||
'description' => 'The character <b>' . $player_name . '</b> has been deleted.'
|
||||
));
|
||||
@ -728,9 +728,9 @@ if(!$logged)
|
||||
}
|
||||
if(!$dontshowtableagain) {
|
||||
if(!empty($errors)) {
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
echo $twig->render('account.delete_character.html');
|
||||
echo $twig->render('account.delete_character.html.twig');
|
||||
}
|
||||
}
|
||||
|
||||
@ -902,7 +902,7 @@ if(!$logged)
|
||||
foreach($loaded_items_to_copy as $save_item)
|
||||
$db->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");
|
||||
|
||||
echo $twig->render('success.html', array(
|
||||
echo $twig->render('success.html.twig', array(
|
||||
'title' => 'Character Created',
|
||||
'description' => 'The character <b>' . $newchar_name . '</b> has been created.<br/>
|
||||
Please select the outfit when you log in for the first time.<br/><br/>
|
||||
@ -918,11 +918,11 @@ if(!$logged)
|
||||
}
|
||||
|
||||
if(count($errors) > 0) {
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
|
||||
if(!$newchar_created) {
|
||||
echo $twig->render('account.create_character.html', array(
|
||||
echo $twig->render('account.create_character.html.twig', array(
|
||||
'config' => $config,
|
||||
'newchar_name' => $newchar_name
|
||||
|
||||
|
@ -48,7 +48,7 @@ $tmp = '';
|
||||
if(fetchDatabaseConfig('site_closed_message', $tmp))
|
||||
$closed_message = $tmp;
|
||||
|
||||
echo $twig->render('admin.dashboard.html', array(
|
||||
echo $twig->render('admin.dashboard.html.twig', array(
|
||||
'is_closed' => $is_closed,
|
||||
'closed_message' => $closed_message,
|
||||
'status' => $status
|
||||
|
@ -20,5 +20,5 @@ if(isset($errors)) {
|
||||
}
|
||||
}
|
||||
|
||||
echo $twig->render('admin.login.html');
|
||||
echo $twig->render('admin.login.html.twig');
|
||||
?>
|
@ -38,7 +38,7 @@ if($preview) {
|
||||
}
|
||||
|
||||
|
||||
echo $twig->render('admin.mailer.html', array(
|
||||
echo $twig->render('admin.mailer.html.twig', array(
|
||||
'mail_subject' => $mail_subject,
|
||||
'mail_content' => $mail_content,
|
||||
'preview_done' => $preview_done
|
||||
|
@ -28,7 +28,7 @@ else
|
||||
$_content = $notepad_content;
|
||||
}
|
||||
|
||||
echo $twig->render('admin.notepad.html', array('content' => isset($_content) ? $_content : null));
|
||||
echo $twig->render('admin.notepad.html.twig', array('content' => isset($_content) ? $_content : null));
|
||||
|
||||
class Notepad
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ if(!empty($action))
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
|
@ -13,7 +13,7 @@ $title = 'Plugin manager';
|
||||
|
||||
require(SYSTEM . 'hooks.php');
|
||||
|
||||
echo $twig->render('admin.plugins.form.html');
|
||||
echo $twig->render('admin.plugins.form.html.twig');
|
||||
|
||||
$message = '';
|
||||
if(isset($_FILES["plugin"]["name"]))
|
||||
@ -142,7 +142,7 @@ foreach(scandir($path) as $file)
|
||||
);
|
||||
}
|
||||
|
||||
echo $twig->render('admin.plugins.html', array(
|
||||
echo $twig->render('admin.plugins.html.twig', array(
|
||||
'plugins' => $rows
|
||||
));
|
||||
?>
|
@ -29,7 +29,7 @@ $total_houses = $query['how_much'];
|
||||
|
||||
$points = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
|
||||
|
||||
echo $twig->render('admin.statistics.html', array(
|
||||
echo $twig->render('admin.statistics.html.twig', array(
|
||||
'total_accounts' => $total_accounts,
|
||||
'total_players' => $total_players,
|
||||
'total_guilds' => $total_guilds,
|
||||
|
@ -29,7 +29,7 @@ function compare($a, $b) {
|
||||
$tmp = $visitors->getVisitors();
|
||||
usort($tmp, 'compare');
|
||||
|
||||
echo $twig->render('admin.visitors.html', array(
|
||||
echo $twig->render('admin.visitors.html.twig', array(
|
||||
'config_visitors_counter_ttl' => $config['visitors_counter_ttl'],
|
||||
'visitors' => $tmp
|
||||
));
|
||||
|
@ -17,7 +17,7 @@ $groups = new OTS_Groups_List();
|
||||
function generate_search_form($autofocus = false)
|
||||
{
|
||||
global $config, $twig;
|
||||
return $twig->render('characters.form.html', array(
|
||||
return $twig->render('characters.form.html.twig', array(
|
||||
'link' => getPageLink('characters'),
|
||||
'vdarkborder' => $config['vdarkborder'],
|
||||
'darkborder' => $config['darkborder'],
|
||||
@ -39,7 +39,7 @@ function retrieve_former_name($name)
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
|
||||
$name = '';
|
||||
@ -395,7 +395,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
|
||||
$account_players->orderBy('name');
|
||||
}
|
||||
|
||||
echo $twig->render('characters.html', array(
|
||||
echo $twig->render('characters.html.twig', array(
|
||||
'outfit' => $outfit,
|
||||
'player' => $player,
|
||||
'account' => $account,
|
||||
@ -439,7 +439,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
|
||||
else
|
||||
{
|
||||
$search_errors[] = 'Character <b>' . $name . '</b> does not exist or has been deleted.';
|
||||
echo $twig->render('error_box.html', array('errors' => $search_errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $search_errors));
|
||||
$search_errors = array();
|
||||
|
||||
$promotion = '';
|
||||
@ -468,4 +468,4 @@ else
|
||||
}
|
||||
|
||||
if(!empty($search_errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $search_errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $search_errors));
|
@ -69,10 +69,10 @@ if($canEdit)
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
|
||||
echo $twig->render('commands.form.html', array(
|
||||
echo $twig->render('commands.form.html.twig', array(
|
||||
'link' => getPageLink('commands', ($action == 'edit' ? 'edit' : 'add')),
|
||||
'action' => $action,
|
||||
'id' => isset($id) ? $id : null,
|
||||
@ -91,7 +91,7 @@ $commands =
|
||||
' ORDER BY `ordering`;');
|
||||
|
||||
$last = $commands->rowCount();
|
||||
echo $twig->render('commands.html', array(
|
||||
echo $twig->render('commands.html.twig', array(
|
||||
'commands' => $commands,
|
||||
'last' => $last,
|
||||
'canEdit' => $canEdit,
|
||||
|
@ -392,7 +392,7 @@ function validate_form(thisform)
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
?>
|
||||
To play on <?php echo $config['lua']['serverName']; ?> you need an account.
|
||||
All you have to do to create your new account is to enter an account <?php echo (USE_ACCOUNT_NAME ? 'name' : 'number'); ?>, password<?php
|
||||
|
@ -153,7 +153,7 @@ if(empty($action))
|
||||
);
|
||||
}
|
||||
|
||||
echo $twig->render('forum.boards.html', array(
|
||||
echo $twig->render('forum.boards.html.twig', array(
|
||||
'boards' => $boards,
|
||||
'config' => $config
|
||||
));
|
||||
@ -404,7 +404,7 @@ if($action == 'new_post')
|
||||
if(!$saved)
|
||||
{
|
||||
if(!empty($errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
echo '<form action="?" method="POST">
|
||||
<input type="hidden" name="action" value="new_post" />
|
||||
@ -520,7 +520,7 @@ if($action == 'edit_post')
|
||||
if(!$saved)
|
||||
{
|
||||
if(!empty($errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
echo '<br /><form action="?" method="POST"><input type="hidden" name="action" value="edit_post" /><input type="hidden" name="id" value="'.$post_id.'" /><input type="hidden" name="subtopic" value="forum" /><input type="hidden" name="save" value="save" /><table width="100%"><tr bgcolor="'.$config['vdarkborder'].'"><td colspan="2"><font color="white"><b>Edit Post</b></font></td></tr><tr bgcolor="'.$config['darkborder'].'"><td width="180"><b>Character:</b></td><td><select name="char_id"><option value="0">(Choose character)</option>';
|
||||
foreach($players_from_account as $player)
|
||||
@ -617,9 +617,9 @@ if($action == 'new_thread')
|
||||
}
|
||||
if (!$saved) {
|
||||
if (!empty($errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
echo $twig->render('forum.new_thread.html', array(
|
||||
echo $twig->render('forum.new_thread.html.twig', array(
|
||||
'section_id' => $section_id,
|
||||
'config' => $config,
|
||||
'players' => $players_from_account,
|
||||
@ -652,7 +652,7 @@ if($action == 'move_thread')
|
||||
{
|
||||
if($post['id'] == $post['first_post'])
|
||||
{
|
||||
echo $twig->render('forum.move_thread.html', array(
|
||||
echo $twig->render('forum.move_thread.html.twig', array(
|
||||
'thread' => $post['post_topic'],
|
||||
'author' => $name[0],
|
||||
'board' => $sections[$post['section']]['name'],
|
||||
|
@ -22,14 +22,14 @@ $config_salt_enabled = fieldExist('salt', 'accounts');
|
||||
$action_type = isset($_REQUEST['action_type']) ? $_REQUEST['action_type'] : '';
|
||||
if($action == '')
|
||||
{
|
||||
echo $twig->render('account.lost.form.html', array(
|
||||
echo $twig->render('account.lost.form.html.twig', array(
|
||||
'vdarkborder' => $config['vdarkborder'],
|
||||
'darkborder' => $config['darkborder'],
|
||||
'template_path' => $template_path
|
||||
));
|
||||
}
|
||||
else if($action == 'step1' && $action_type == '') {
|
||||
echo $twig->render('account.lost.noaction.html', array(
|
||||
echo $twig->render('account.lost.noaction.html.twig', array(
|
||||
'template_path' => $template_path
|
||||
));
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ if(isset($_GET['archive']))
|
||||
}
|
||||
}
|
||||
|
||||
echo $twig->render('news.html', array(
|
||||
echo $twig->render('news.html.twig', array(
|
||||
'title' => stripslashes($news['title']),
|
||||
'content' => $content,
|
||||
'date' => $news['date'],
|
||||
@ -112,8 +112,6 @@ define('TITLE_LIMIT', 100);
|
||||
define('BODY_LIMIT', 65535); // maximum news body length
|
||||
|
||||
$canEdit = hasFlag(FLAG_CONTENT_NEWS) || superAdmin();
|
||||
if($canEdit)
|
||||
echo '<script type="text/javascript" src="' . BASE_URL . 'tools/tiny_mce/tiny_mce.js"></script>';
|
||||
if($canEdit)
|
||||
{
|
||||
if(!empty($action))
|
||||
@ -165,7 +163,7 @@ if($canEdit)
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
if($cache->enabled())
|
||||
{
|
||||
@ -273,154 +271,31 @@ if(!$news_cached)
|
||||
ob_start();
|
||||
if($canEdit)
|
||||
{
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
tinyMCE.init({
|
||||
forced_root_block : false,
|
||||
if($action == 'edit') {
|
||||
$player = new OTS_Player();
|
||||
$player->load($player_id);
|
||||
}
|
||||
|
||||
$account_players = $account_logged->getPlayersList();
|
||||
$account_players->orderBy('group_id', POT::ORDER_DESC);
|
||||
|
||||
mode : "textareas",
|
||||
theme : "advanced",
|
||||
plugins: "safari,advimage,emotions,insertdatetime,preview,wordcount",
|
||||
|
||||
theme_advanced_buttons3_add : "emotions,insertdate,inserttime,preview,|,forecolor,backcolor",
|
||||
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,
|
||||
});
|
||||
</script>
|
||||
<?php if($action != 'edit'): ?>
|
||||
<a id="news-button" href="#">Add news</a>
|
||||
<?php endif; ?>
|
||||
<form method="post" action="<?php echo getPageLink('news', ($action == 'edit' ? 'edit' : 'add')); ?>">
|
||||
<?php if($action == 'edit'): ?>
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<?php endif; ?>
|
||||
<table id="news-edit" width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="<?php echo $config['vdarkborder']; ?>" class="white"><b><?php echo ($action == 'edit' ? 'Edit' : 'Add'); ?> news</b></td>
|
||||
</tr>
|
||||
|
||||
<?php $rows = 0; ?>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td><b>Title:</b></td>
|
||||
<td><input name="title" value="<?php echo (isset($p_title) ? $p_title : ''); ?>" size="50" maxlength="100"/></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<!--td>Description:</td-->
|
||||
<td colspan="2"><textarea name="body" maxlength="<?php echo BODY_LIMIT; ?>" class="tinymce"><?php echo (isset($body) ? $body : ''); ?></textarea></td>
|
||||
<tr/>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td><b>Type:</b></td>
|
||||
<td>
|
||||
<select name="type">
|
||||
<option value="<?php echo NEWS; ?>" <?php echo (isset($type) && $type == NEWS ? 'selected="yes"' : ''); ?>>News</option>
|
||||
<option value="<?php echo TICKET; ?>" <?php echo (isset($type) && $type == TICKET ? 'selected="yes"' : ''); ?>>Ticket</option>
|
||||
<!--option value="<?php echo ARTICLE; ?>">Article</option-->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if($action == 'edit')
|
||||
{
|
||||
$player = $ots->createObject('Player');
|
||||
$player->load($player_id);
|
||||
if($player->isLoaded())
|
||||
{
|
||||
?>
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td width="180"><b>Author:</b></td>
|
||||
<td>
|
||||
<select name="original_id" disabled="disabled">
|
||||
<?php
|
||||
echo '<option value="' . $player->getId() . '">' . $player->getName() . '</option>';
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td width="180"><b><?php echo ($action == 'edit' ? 'Modified by' : 'Author'); ?>:</b></td>
|
||||
<td>
|
||||
<select name="player_id">
|
||||
<?php
|
||||
$account_players = $account_logged->getPlayersList();
|
||||
$account_players->orderBy('group_id', POT::ORDER_DESC);
|
||||
$player_number = 0;
|
||||
foreach($account_players as $player)
|
||||
{
|
||||
echo '<option value="' . $player->getId() . '"';
|
||||
if(isset($player_id) && $player->getId() == $player_id)
|
||||
echo ' selected="selected"';
|
||||
echo '>' . $player->getName() . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td><b>Category:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
if(!isset($category))
|
||||
$category = 0;
|
||||
foreach($categories as $id => $cat): ?>
|
||||
<input type="radio" name="category" value="<?php echo $id; ?>" <?php echo (((isset($category) && $category == 0 && $id == 1) || (isset($category) && $category == $id)) ? 'checked="yes"' : ''); ?>/> <img src="images/news/icon_<?php echo $cat['icon_id']; ?>_small.gif" />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($action == ''):
|
||||
?>
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td><b>Create forum thread in section:</b></td>
|
||||
<td>
|
||||
<select name="forum_section">
|
||||
<option value="-1">None</option>
|
||||
<?php
|
||||
foreach(getForumSections() as $section): ?>
|
||||
<option value="<?php echo $section['id']; ?>" <?php echo (isset($forum_section) && $forum_section == $section['id']) ? 'checked="yes"' : ''; ?>/><?php echo $section['name']; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td align="right">
|
||||
<input type="submit" value="Submit"/>
|
||||
</td>
|
||||
<td align="left">
|
||||
<input type="button" onclick="window.location = '<?php echo getPageLink(PAGE); ?>';" value="Cancel"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php if($action != 'edit'): ?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#news-edit").hide();
|
||||
});
|
||||
|
||||
$("#news-button").click(function() {
|
||||
$("#news-edit").toggle();
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
echo $twig->render('news.add.html.twig', array(
|
||||
'config' => $config,
|
||||
'action' => $action,
|
||||
'news_link' => getPageLink(PAGE),
|
||||
'news_link_form' => getPageLink('news', ($action == 'edit' ? 'edit' : 'add')),
|
||||
'news_id' => isset($id) ? $id : null,
|
||||
'title' => isset($p_title) ? $p_title : '',
|
||||
'body' => isset($body) ? $body : '',
|
||||
'type' => isset($type) ? $type : null,
|
||||
'player' => isset($player) && $player->isLoaded() ? $player : null,
|
||||
'player_id' => isset($player_id) ? $player_id : null,
|
||||
'account_players' => $account_players,
|
||||
'category' => isset($category) ? $category : 0,
|
||||
'categories' => $categories,
|
||||
'forum_sections' => getForumSections(),
|
||||
'forum_section' => isset($forum_section) ? $forum_section : null
|
||||
));
|
||||
}
|
||||
|
||||
$newses =
|
||||
@ -467,7 +342,7 @@ if(!$news_cached)
|
||||
}
|
||||
}
|
||||
|
||||
echo $twig->render('news.html', array(
|
||||
echo $twig->render('news.html.twig', array(
|
||||
'title' => stripslashes($news['title']),
|
||||
'content' => $content . $admin_options,
|
||||
'date' => $news['date'],
|
||||
|
@ -53,10 +53,10 @@ if($canEdit) {
|
||||
}
|
||||
|
||||
if (!empty($errors))
|
||||
echo $twig->render('error_box.html', array('errors' => $errors));
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
|
||||
echo $twig->render('screenshots.form.html', array(
|
||||
echo $twig->render('screenshots.form.html.twig', array(
|
||||
'link' => getPageLink('screenshots', ($action == 'edit' ? 'edit' : 'add')),
|
||||
'action' => $action,
|
||||
'id' => isset($id) ? $id : null,
|
||||
@ -94,7 +94,7 @@ if(isset($_GET['screenshot']))
|
||||
else
|
||||
$next_screenshot = NULL;
|
||||
|
||||
echo $twig->render('screenshots.get.html', array(
|
||||
echo $twig->render('screenshots.get.html.twig', array(
|
||||
'previous' => $previous_screenshot ? $previous_screenshot['id'] : null,
|
||||
'next' => $next_screenshot ? $next_screenshot['id'] : null,
|
||||
'screenshot' => $screenshot
|
||||
@ -118,7 +118,7 @@ if(!$last)
|
||||
return;
|
||||
}
|
||||
|
||||
echo $twig->render('screenshots.html', array(
|
||||
echo $twig->render('screenshots.html.twig', array(
|
||||
'screenshots' => $screenshots,
|
||||
'last' => $last,
|
||||
'canEdit' => $canEdit
|
||||
|
@ -94,6 +94,6 @@ if($config['forum'] != '')
|
||||
}
|
||||
|
||||
$twig->addGlobal('template_path', $template_path);
|
||||
if($twig_loader && file_exists(BASE . $template_path . '/templates'))
|
||||
$twig_loader->prependPath(BASE . $template_path . '/templates');
|
||||
if($twig_loader && file_exists(BASE . $template_path))
|
||||
$twig_loader->prependPath(BASE . $template_path);
|
||||
?>
|
||||
|
130
system/templates/news.add.html.twig
Normal file
130
system/templates/news.add.html.twig
Normal file
@ -0,0 +1,130 @@
|
||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tiny_mce/tiny_mce.js"></script>
|
||||
<script type="text/javascript">
|
||||
tinyMCE.init({
|
||||
forced_root_block : false,
|
||||
|
||||
mode : "textareas",
|
||||
theme : "advanced",
|
||||
plugins: "safari,advimage,emotions,insertdatetime,preview,wordcount",
|
||||
|
||||
theme_advanced_buttons3_add : "emotions,insertdate,inserttime,preview,|,forecolor,backcolor",
|
||||
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,
|
||||
});
|
||||
</script>
|
||||
{% if action != 'edit' %}
|
||||
<a id="news-button" href="#">Add news</a>
|
||||
{% endif %}
|
||||
<form method="post" action="{{ news_link_form }}">
|
||||
{% if action == 'edit' %}
|
||||
<input type="hidden" name="id" value="{{ news_id }}" />
|
||||
{% endif %}
|
||||
<table id="news-edit" width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="{{ config.vdarkborder }}" class="white"><b>{% if action == 'edit'%}Edit{% else %}Add{% endif %} news</b></td>
|
||||
</tr>
|
||||
|
||||
{% set rows = 1 %}
|
||||
|
||||
{% set rows = rows + 1 %}
|
||||
<tr bgcolor="{{ getStyle(rows) }}">
|
||||
<td><b>Title:</b></td>
|
||||
<td><input name="title" value="{{ title }}" size="50" maxlength="100"/></td>
|
||||
</tr>
|
||||
|
||||
{% set rows = rows + 1 %}
|
||||
<tr bgcolor="{{ getStyle(rows) }}">
|
||||
<!--td>Description:</td-->
|
||||
<td colspan="2"><textarea name="body" maxlength="{{ constant('BODY_LIMIT') }}" class="tinymce">{{ body }}</textarea></td>
|
||||
<tr/>
|
||||
|
||||
{% set rows = rows + 1 %}
|
||||
<tr bgcolor="{{ getStyle(rows) }}">
|
||||
<td><b>Type:</b></td>
|
||||
<td>
|
||||
<select name="type">
|
||||
<option value="{{ constant('NEWS') }}" {% if type is defined and type == constant('NEWS') %}selected="yes"{% endif %}>News</option>
|
||||
<option value="{{ constant('TICKET') }}" {% if type is defined and type == constant('TICKET') %}selected="yes"{% endif %}>Ticket</option>
|
||||
<!--option value="{{ constant('ARTICLE') }}">Article</option-->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% if action == 'edit' %}
|
||||
{% set rows = rows + 1 %}
|
||||
{% if player is defined %}
|
||||
<tr bgcolor="{{ getStyle(rows) }}">
|
||||
<td width="180"><b>Author:</b></td>
|
||||
<td>
|
||||
<select name="original_id" disabled="disabled">
|
||||
<option value="{{ player.getId() }}">{{ player.getName() }}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% set rows = rows + 1 %}
|
||||
<tr bgcolor="{{ getStyle(rows) }}">
|
||||
<td width="180"><b>{% if action == 'edit' %}Modified by{% else %}Author{% endif %}:</b></td>
|
||||
<td>
|
||||
<select name="player_id">
|
||||
{% for player in account_players %}
|
||||
<option value="{{ player.getId() }}"{% if player_id is defined and player.getId() == player_id %} selected="selected"{% endif %}>{{ player.getName() }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% set rows = rows + 1 %}
|
||||
<tr bgcolor="{{ getStyle(rows) }}">
|
||||
<td><b>Category:</b></td>
|
||||
<td>
|
||||
{% for id, cat in categories %}
|
||||
<input type="radio" name="category" value="{{ id }}" {% if (category == 0 and id == 1) or (category == id) %}checked="yes"{% endif %}/> <img src="images/news/icon_{{ cat.icon_id }}_small.gif" />
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% if action == '' %}
|
||||
{% set rows = rows + 1 %}
|
||||
<tr bgcolor="{{ getStyle(rows) }}">
|
||||
<td><b>Create forum thread in section:</b></td>
|
||||
<td>
|
||||
<select name="forum_section">
|
||||
<option value="-1">None</option>
|
||||
{% for section in forum_sections %}
|
||||
<option value="{{ section.id }}" {% if forum_section is defined and forum_section == section.id %}checked="yes"{% endif %}/>{{ section.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% set rows = rows + 1 %}
|
||||
<tr bgcolor="{{ getStyle(rows) }}">
|
||||
<td align="right">
|
||||
<input type="submit" value="Submit"/>
|
||||
</td>
|
||||
<td align="left">
|
||||
<input type="button" onclick="window.location = '{{ news_link }}';" value="Cancel"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
{% if action != 'edit' %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#news-edit").hide();
|
||||
});
|
||||
|
||||
$("#news-button").click(function() {
|
||||
$("#news-edit").toggle();
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
Loading…
x
Reference in New Issue
Block a user