Change <? to <?php and add some formatting
This commit is contained in:
@@ -1,21 +1 @@
|
||||
<?␍
|
||||
$xmla = simplexml_load_file('../db/todoist.xml');␍
|
||||
if(isset($_POST['token'])){␍
|
||||
$token = trim($_POST['token']);␍
|
||||
␍
|
||||
$xmla->addChild("token", $token);␍
|
||||
␍
|
||||
$xmla->asXML('../db/todoist.xml');␍
|
||||
␍
|
||||
echo "ok";␍
|
||||
}else if(isset($_POST['name']) && isset($_POST['id'])){␍
|
||||
$name = trim($_POST['name']);␍
|
||||
$id = trim($_POST['id']);␍
|
||||
␍
|
||||
$xmla->addChild("name", $name);␍
|
||||
$xmla->addChild("id", $id);␍
|
||||
␍
|
||||
$xmla->asXML('../db/todoist.xml');␍
|
||||
␍
|
||||
echo "ok";␍
|
||||
}
|
||||
<?php␍␍$xmla = simplexml_load_file('../db/todoist.xml');␍␍if (isset($_POST['token'])) {␍␍ $token = trim($_POST['token']);␍ $xmla->addChild("token", $token);␍ $xmla->asXML('../db/todoist.xml');␍ echo "ok";␍␍} else if (isset($_POST['name']) && isset($_POST['id'])) {␍␍ $name = trim($_POST['name']);␍ $id = trim($_POST['id']);␍ $xmla->addChild("name", $name);␍ $xmla->addChild("id", $id);␍ $xmla->asXML('../db/todoist.xml');␍␍ echo "ok";␍␍}
|
||||
@@ -1,3 +1 @@
|
||||
<?␍$xmla = simplexml_load_file('../db/todoist.xml');␍if($xmla->token== '' || $xmla->token == null)␍ header('Location: install-todoist.php');␍if($xmla->name == '' || $xmla->name == null):?>␍<html> ␍ <head> ␍ <style>␍ .selectableProject{text-decoration:underline; color:blue; cursor:pointer;}␍ </style>
|
||||
<title>Todoist : getProjects</title> ␍ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>␍ <script type="text/javascript" src="../js/getProjectsList.php?token=<?=$xmla->token?>"></script>␍ </head> ␍ <body> ␍
|
||||
</body> ␍ </html> ␍ <? else:␍ header('Location: ../../../');␍ endif;
|
||||
<?php␍$xmla = simplexml_load_file('../db/todoist.xml');␍if($xmla->token== '' || $xmla->token == null)␍ header('Location: install-todoist.php');␍if($xmla->name == '' || $xmla->name == null):?>␍<html> ␍ <head> ␍ <style>␍ .selectableProject{text-decoration:underline; color:blue; cursor:pointer;}␍ </style>␍ <title>Todoist : getProjects</title> ␍ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>␍ <script type="text/javascript" src="../js/getProjectsList.php?token=<?=$xmla->token?>"></script>␍ </head> ␍ <body> ␍␍ </body> ␍ </html> ␍ <?php else:␍ header('Location: ../../../');␍ endif;
|
||||
@@ -1,12 +1 @@
|
||||
<?␍
|
||||
$xmla = simplexml_load_file('../db/todoist.xml');␍
|
||||
if($xmla->token== '' || $xmla->token == null)␍
|
||||
header('Location: install-todoist.php');␍
|
||||
if($xmla->id != '' || $xmla->id != null): ␍
|
||||
$token = $xmla->token;␍
|
||||
$id = $xmla->id;?>␍
|
||||
␍
|
||||
<script type="text/javascript" src="../js/getUncompletedTasks.php?token=<?=$token?>&id=<?=$id?>"></script>␍
|
||||
<? else:␍
|
||||
header('Location: getProjectsList.php');␍
|
||||
endif;
|
||||
<?php␍␍$xmla = simplexml_load_file('../db/todoist.xml');␍␍if($xmla->token== '' || $xmla->token == null)␍␍ header('Location: install-todoist.php');␍␍if($xmla->id != '' || $xmla->id != null): ␍␍$token = $xmla->token;␍␍$id = $xmla->id;?>␍␍␍␍<script type="text/javascript" src="../js/getUncompletedTasks.php?token=<?php echo $token; ?>&id=<?php echo $id; ?>"></script>␍␍ <?php else:␍␍ header('Location: getProjectsList.php');␍␍ endif;
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
$xmla = simplexml_load_file('../db/todoist.xml');
|
||||
if($xmla->token == '' || $xmla->token == null):?>
|
||||
<html>
|
||||
@@ -18,7 +18,7 @@ if($xmla->token == '' || $xmla->token == null):?>
|
||||
</fieldset>
|
||||
</body>
|
||||
</html>
|
||||
<?
|
||||
<?php
|
||||
else:
|
||||
header('Location: getProjectsList.php');
|
||||
endif;
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
<?header('Content-type: application/javascript');␍
|
||||
$token = $_GET['token'];␍
|
||||
?>␍
|
||||
function cbfunc(o){ ␍ $('body').append('<div id="results"><h2>Select your project</h2></div>');␍ $('#results').append('<ul id="uncompletedList"><ul>');␍ for(var i in o)␍ {␍ $('#uncompletedList').append('<li id="'+o[i].id+'" class="selectableProject">'+o[i].name+'</li>');␍ }␍}␍
|
||||
$(document).ready(function(){␍ var token = "<?=$token?>";␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/getProjects?token='+token+'&format=json&callback=cbfunc';␍ document.getElementsByTagName('head')[0].appendChild(script); ␍␍ $('.selectableProject').live('click', function(){␍ var name = $(this).text();␍ var id = $(this).attr('id');␍ $.post('../ajax/saveTodoist.php', {name: name, id: id}, function(msg){ ␍ $('body').append('<a href="index.php">Etape suivante</a>');␍ if(msg=="ok"){␍ location.reload();␍ }else{␍ alert(msg);␍ }␍ }); ␍ });
|
||||
});
|
||||
<?header('Content-type: application/javascript');␍␍$token = $_GET['token'];␍␍?>␍␍function cbfunc(o){ ␍ $('body').append('<div id="results"><h2>Select your project</h2></div>');␍ $('#results').append('<ul id="uncompletedList"><ul>');␍ for(var i in o)␍ {␍ $('#uncompletedList').append('<li id="'+o[i].id+'" class="selectableProject">'+o[i].name+'</li>');␍ }␍}␍␍$(document).ready(function(){␍ var token = "<?php echo $token; ?>";␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/getProjects?token='+token+'&format=json&callback=cbfunc';␍ document.getElementsByTagName('head')[0].appendChild(script); ␍␍ $('.selectableProject').live('click', function(){␍ var name = $(this).text();␍ var id = $(this).attr('id');␍ $.post('../ajax/saveTodoist.php', {name: name, id: id}, function(msg){ ␍ $('body').append('<a href="index.php">Etape suivante</a>');␍ if(msg=="ok"){␍ location.reload();␍ }else{␍ alert(msg);␍ }␍ }); ␍ });␍});
|
||||
@@ -1,9 +1 @@
|
||||
<?header('Content-type: application/javascript');␍$token = $_GET['token'];␍$id = $_GET['id'];␍?>␍
|
||||
function cbfunc(o){␍ $('#results').append('<ul id="uncompletedList"><ul>');␍ for(var i in o)␍ {␍ $('#uncompletedList').append('<li id="'+o[i].id+'">'+o[i].content+' - '+o[i].date_string+' <img src="images/interface/delete.png" class="deleteTask" id="delete-'+o[i].id+'"/> <img src="images/interface/complete.png" class="completeTask" id="complete-'+o[i].id+'"/> </li>');␍ }␍ $('#uncompletedList li').prepend('<div class="puce"></div>');␍}␍
|
||||
function cbfunc2(o){␍ $('#uncompletedList').append('<li id="'+o.id+'">'+o.content+' - '+o.date_string+' <img src="images/interface/delete.png" id="delete-'+o.id+'"/> <img src="images/interface/complete.png" class="completeTask" id="complete-'+o.id+'"/> </li>');␍}␍
|
||||
$(document).ready(function(){␍ $('#todo').resizable();␍ $('#todo').draggable();␍ $('#todo').append('<div id="results"></div><img src="images/interface/add.png" id="showNewTask"/><fieldset id="newTaskFieldset" style="display:none; width:200px;"><input type="text" name="newtask" id="newtask"/> <select id="priority"><option id="1" value="1">1</option><option id="2" value="2">2</option><option id="3" value="3">3</option><option id="4" value="4">4</option></select> <br/><input type="text" name="date_string" id="date_string"/> <img src="images/interface/add.png" id="addTask"/></fieldset>');␍ var token = "<?=$token?>";␍ var project_id = "<?=$id?>";␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/getUncompletedItems?project_id='+project_id+'&token='+token+'&format=json&callback=cbfunc';␍ document.getElementsByTagName('head')[0].appendChild(script); ␍
|
||||
$('#showNewTask').click(function(){␍ $('#newTaskFieldset').toggle();␍ });␍
|
||||
$('#addTask').click(function(){␍ var content = $('#newtask').val();␍ var date_string = $('#date_string').val();␍ var priority = $('#priority').val();␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/addItem?project_id='+project_id+'&token='+token+'&content='+content+'&date_string='+date_string+'&priority='+priority+'&format=json&callback=cbfunc2';␍ document.getElementsByTagName('head')[0].appendChild(script); ␍ });␍
|
||||
$('.deleteTask').live('click', function(){␍ var id = $(this).attr('id');␍ arrayId = id.split('-');␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/deleteItems?ids=["'+arrayId[1]+'"]&token='+token;␍ document.getElementsByTagName('head')[0].appendChild(script); ␍ $('#'+arrayId[1]).remove();␍ });␍ ␍ $('.completeTask').live('click', function(){␍ var id = $(this).attr('id');␍ arrayId = id.split('-');␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/completeItems?ids=["'+arrayId[1]+'"]&token='+token;␍ document.getElementsByTagName('head')[0].appendChild(script); ␍ $('#'+arrayId[1]).remove(); ␍ });␍
|
||||
␍/* A helper function for converting a set of elements to draggables: */␍make_draggable($('#todo'));␍
|
||||
});
|
||||
<?header('Content-type: application/javascript');␍$token = $_GET['token'];␍$id = $_GET['id'];␍?>␍␍function cbfunc(o){␍ $('#results').append('<ul id="uncompletedList"><ul>');␍ for(var i in o)␍ {␍ $('#uncompletedList').append('<li id="'+o[i].id+'">'+o[i].content+' - '+o[i].date_string+' <img src="images/interface/delete.png" class="deleteTask" id="delete-'+o[i].id+'"/> <img src="images/interface/complete.png" class="completeTask" id="complete-'+o[i].id+'"/> </li>');␍ }␍ $('#uncompletedList li').prepend('<div class="puce"></div>');␍}␍␍function cbfunc2(o){␍ $('#uncompletedList').append('<li id="'+o.id+'">'+o.content+' - '+o.date_string+' <img src="images/interface/delete.png" id="delete-'+o.id+'"/> <img src="images/interface/complete.png" class="completeTask" id="complete-'+o.id+'"/> </li>');␍}␍␍$(document).ready(function(){␍ $('#todo').resizable();␍ $('#todo').draggable();␍ $('#todo').append('<div id="results"></div><img src="images/interface/add.png" id="showNewTask"/><fieldset id="newTaskFieldset" style="display:none; width:200px;"><input type="text" name="newtask" id="newtask"/> <select id="priority"><option id="1" value="1">1</option><option id="2" value="2">2</option><option id="3" value="3">3</option><option id="4" value="4">4</option></select> <br/><input type="text" name="date_string" id="date_string"/> <img src="images/interface/add.png" id="addTask"/></fieldset>');␍ var token = "<?php echo $token; ?>";␍ var project_id = "<?php echo $id; ?>";␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/getUncompletedItems?project_id='+project_id+'&token='+token+'&format=json&callback=cbfunc';␍ document.getElementsByTagName('head')[0].appendChild(script); ␍␍ $('#showNewTask').click(function(){␍ $('#newTaskFieldset').toggle();␍ });␍␍ $('#addTask').click(function(){␍ var content = $('#newtask').val();␍ var date_string = $('#date_string').val();␍ var priority = $('#priority').val();␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/addItem?project_id='+project_id+'&token='+token+'&content='+content+'&date_string='+date_string+'&priority='+priority+'&format=json&callback=cbfunc2';␍ document.getElementsByTagName('head')[0].appendChild(script); ␍ });␍␍ $('.deleteTask').live('click', function(){␍ var id = $(this).attr('id');␍ arrayId = id.split('-');␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/deleteItems?ids=["'+arrayId[1]+'"]&token='+token;␍ document.getElementsByTagName('head')[0].appendChild(script); ␍ $('#'+arrayId[1]).remove();␍ });␍ ␍ $('.completeTask').live('click', function(){␍ var id = $(this).attr('id');␍ arrayId = id.split('-');␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/completeItems?ids=["'+arrayId[1]+'"]&token='+token;␍ document.getElementsByTagName('head')[0].appendChild(script); ␍ $('#'+arrayId[1]).remove(); ␍ });␍␍␍/* A helper function for converting a set of elements to draggables: */␍make_draggable($('#todo'));␍␍});
|
||||
Reference in New Issue
Block a user