Check in tweet monitor
139
admin/add-account.php
Normal file
|
@ -0,0 +1,139 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
include('../config/config.php');
|
||||||
|
include('html/html.inc.php');
|
||||||
|
include('includes/functions.php');
|
||||||
|
include('includes/tmhOAuth.php');
|
||||||
|
include('../includes/classes/class.Tweet.php');
|
||||||
|
include('../includes/classes/class.User.php');
|
||||||
|
checkLoginAdmin();
|
||||||
|
|
||||||
|
$objUser=new User();
|
||||||
|
$objTweet=new Tweet();
|
||||||
|
|
||||||
|
if ( isset($_POST['submit']) )
|
||||||
|
{
|
||||||
|
|
||||||
|
$screen_name=clean($_POST['username']);
|
||||||
|
$exist=$objUser->checkUserExist($screen_name);
|
||||||
|
|
||||||
|
if($exist)
|
||||||
|
{
|
||||||
|
$connection = new tmhOAuth(array( 'consumer_key' => $consumer_key, 'consumer_secret' => $consumer_secret, 'user_token' => $user_token, 'user_secret' => $user_secret ));
|
||||||
|
$http_code = $connection->request('GET',$connection->url('1.1/statuses/user_timeline'), array('screen_name' => $screen_name,'count'=>200));
|
||||||
|
|
||||||
|
if ($http_code == 200)
|
||||||
|
{
|
||||||
|
$tweet_data = json_decode($connection->response['response'],true);
|
||||||
|
|
||||||
|
$userArray=array();
|
||||||
|
foreach($tweet_data as $user)
|
||||||
|
{
|
||||||
|
$userArray=$user['user'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$objUser->id=$userArray['id_str'];
|
||||||
|
$objUser->screen_name=$screen_name;
|
||||||
|
$objUser->name=$userArray['name'];
|
||||||
|
$objUser->profile_image_url=$userArray['profile_image_url'];
|
||||||
|
$objUser->location=$userArray['location'];
|
||||||
|
$objUser->created_at=date('y-m-d h:m:s',strtotime($userArray['created_at']));
|
||||||
|
$objUser->friends_count=$userArray['friends_count'];
|
||||||
|
$objUser->followers_count=$userArray['followers_count'];
|
||||||
|
$objUser->statuses_count=$userArray['statuses_count'];
|
||||||
|
$objUser->addUserAccount();
|
||||||
|
|
||||||
|
foreach($tweet_data as $tweet)
|
||||||
|
{
|
||||||
|
if(isset($tweet['retweeted_status']))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$objTweet->id=$tweet['id_str'];
|
||||||
|
$objTweet->tweet_text=base64_encode($tweet['text']);
|
||||||
|
$objTweet->created_at=date('y-m-d h:m:s',strtotime($tweet['created_at']));
|
||||||
|
$objTweet->user_id=$userArray['id_str'];
|
||||||
|
$objTweet->saveTweet();
|
||||||
|
}
|
||||||
|
|
||||||
|
$redirectUrl = 'view-accounts.php';
|
||||||
|
$_SESSION['succesMessage'] = 4;
|
||||||
|
header("Location: $redirectUrl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($http_code == 429)
|
||||||
|
{
|
||||||
|
$_SESSION['errorMessage'] = 2;
|
||||||
|
$redirectUrl = 'add-account.php';
|
||||||
|
header("Location: $redirectUrl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$_SESSION['errorMessage'] = 3;
|
||||||
|
$redirectUrl = 'add-account.php';
|
||||||
|
header("Location: $redirectUrl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$_SESSION['errorMessage'] = 4;
|
||||||
|
$redirectUrl = 'add-account.php';
|
||||||
|
header("Location: $redirectUrl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
startHtml($title = "Add Twitter Account");
|
||||||
|
tophead($title);
|
||||||
|
leftNav();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<script src="<?php echo ADMIN_JS;?>accounts.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( isset($_SESSION['succesMessage']) )
|
||||||
|
{
|
||||||
|
successMsg($_SESSION['succesMessage']);
|
||||||
|
unset($_SESSION['succesMessage']);
|
||||||
|
}
|
||||||
|
else if(isset($_SESSION['errorMessage']))
|
||||||
|
{
|
||||||
|
errorMsg($_SESSION['errorMessage']);
|
||||||
|
unset($_SESSION['errorMessage']);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<section id="main" class="column">
|
||||||
|
<article class="module width_half">
|
||||||
|
<header>
|
||||||
|
<h3>Add Twitter Account</h3>
|
||||||
|
</header>
|
||||||
|
<form name="addAccount" id="addAccount" action="" method="post">
|
||||||
|
<fieldset style="margin:15px">
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label>Twitter Username</label>
|
||||||
|
<input type="text" name="username" id="username" value=""/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="submit" name="submit" id="submit" value="Add Account" />
|
||||||
|
<input type="button" name="cancel" id="cancel" value="Cancel" onclick="window.location='<?php echo ADMIN_URL."view-accounts.php";?>'" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</article>
|
||||||
|
<div class="spacer"></div>
|
||||||
|
</section>
|
||||||
|
<?php
|
||||||
|
endHtml();
|
||||||
|
?>
|
70
admin/change-email.php
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
<?php
|
||||||
|
include('../config/config.php');
|
||||||
|
include('html/html.inc.php');
|
||||||
|
include('includes/functions.php');
|
||||||
|
checkLoginAdmin();
|
||||||
|
|
||||||
|
if ( isset($_POST['submit']) )
|
||||||
|
{
|
||||||
|
$updateQry = "UPDATE admin
|
||||||
|
SET
|
||||||
|
email = '".clean($_POST['newEmail'])."'
|
||||||
|
WHERE id = '".$_SESSION['user_login_id']."'";
|
||||||
|
mysql_query($updateQry);
|
||||||
|
|
||||||
|
$_SESSION['email'] = clean($_POST['newEmail']);
|
||||||
|
$redirectUrl = basename($_SERVER['PHP_SELF']);
|
||||||
|
$_SESSION['succesMessage'] = 3;
|
||||||
|
header("Location: $redirectUrl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
startHtml($title = "Change Email");
|
||||||
|
tophead($title);
|
||||||
|
leftNav();
|
||||||
|
?>
|
||||||
|
<script src="<?php echo ADMIN_JS;?>accounts.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( isset($_SESSION['succesMessage']) )
|
||||||
|
{
|
||||||
|
successMsg($_SESSION['succesMessage']);
|
||||||
|
unset($_SESSION['succesMessage']);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<section id="main" class="column">
|
||||||
|
<article class="module width_half">
|
||||||
|
<header>
|
||||||
|
<h3>Change Email</h3>
|
||||||
|
</header>
|
||||||
|
<form name="changeEmailForm" id="changeEmailForm" action="" method="post">
|
||||||
|
<fieldset style="margin:15px">
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label>Old Email</label>
|
||||||
|
<input type="text" name="username" id="username" value="<?php echo $_SESSION['email'];?>"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label>New Email</label>
|
||||||
|
<input type="text" name="newEmail" id="newEmail">
|
||||||
|
<input type="hidden" name="usernameHidd" id="usernameHidd" value="<?php echo $_SESSION['email'];?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="submit" name="submit" id="submit" value="Change Email" />
|
||||||
|
<input type="button" name="cancel" id="cancel" value="Cancel" onclick="window.location='<?php echo ADMIN_URL;?>'" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</article>
|
||||||
|
<div class="spacer"></div>
|
||||||
|
</section>
|
||||||
|
<?php
|
||||||
|
endHtml();
|
||||||
|
?>
|
75
admin/change-password.php
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
<?php
|
||||||
|
include('../config/config.php');
|
||||||
|
include('html/html.inc.php');
|
||||||
|
include('includes/functions.php');
|
||||||
|
checkLoginAdmin();
|
||||||
|
|
||||||
|
if ( isset($_POST['submit']) )
|
||||||
|
{
|
||||||
|
$updateQry = "UPDATE admin
|
||||||
|
SET
|
||||||
|
password = '".clean($_POST['newPassword'])."'
|
||||||
|
WHERE id = '".$_SESSION['user_login_id']."'";
|
||||||
|
mysql_query($updateQry);
|
||||||
|
$_SESSION['password'] = clean($_POST['newPassword']);
|
||||||
|
|
||||||
|
$_SESSION['succesMessage'] = 2;
|
||||||
|
header("Location: $redirectUrl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
startHtml($title = "Change Password");
|
||||||
|
tophead($title);
|
||||||
|
leftNav();
|
||||||
|
?>
|
||||||
|
<script src="<?php echo ADMIN_JS;?>accounts.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( isset($_SESSION['succesMessage']) )
|
||||||
|
{
|
||||||
|
successMsg($_SESSION['succesMessage']);
|
||||||
|
unset($_SESSION['succesMessage']);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<section id="main" class="column">
|
||||||
|
<article class="module width_half">
|
||||||
|
<header>
|
||||||
|
<h3>Change Password</h3>
|
||||||
|
</header>
|
||||||
|
<form name="changePassForm" id="changePassForm" action="" method="post">
|
||||||
|
<fieldset style="margin:15px">
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label>Old Password</label>
|
||||||
|
<input type="password" name="oldPassword" id="oldPassword" value="<?php echo $_SESSION['password'];?>"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label>New Password</label>
|
||||||
|
<input type="password" name="newPassword" id="newPassword">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label>Confirm New Password</label>
|
||||||
|
<input type="password" name="confirmPassword" id="confirmPassword">
|
||||||
|
<input type="hidden" name="oldHidPass" id="oldHidPass" value="<?php echo $_SESSION['password'];?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="submit" name="submit" id="submit" value="Change Password" />
|
||||||
|
<input type="button" name="cancel" id="cancel" value="Cancel" onclick="window.location='<?php echo ADMIN_URL;?>'" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</article>
|
||||||
|
<div class="spacer"></div>
|
||||||
|
</section>
|
||||||
|
<?php
|
||||||
|
endHtml();
|
||||||
|
?>
|
551
admin/css/datatable_jui.css
Normal file
|
@ -0,0 +1,551 @@
|
||||||
|
/*
|
||||||
|
* File: demo_table_jui.css
|
||||||
|
* CVS: $Id$
|
||||||
|
* Description: CSS descriptions for DataTables demo pages
|
||||||
|
* Author: Allan Jardine
|
||||||
|
* Created: Tue May 12 06:47:22 BST 2009
|
||||||
|
* Modified: $Date$ by $Author$
|
||||||
|
* Language: CSS
|
||||||
|
* Project: DataTables
|
||||||
|
*
|
||||||
|
* Copyright 2009 Allan Jardine. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* ***************************************************************************
|
||||||
|
* DESCRIPTION
|
||||||
|
*
|
||||||
|
* The styles given here are suitable for the demos that are used with the standard DataTables
|
||||||
|
* distribution (see www.datatables.net). You will most likely wish to modify these styles to
|
||||||
|
* meet the layout requirements of your site.
|
||||||
|
*
|
||||||
|
* Common issues:
|
||||||
|
* 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is
|
||||||
|
* no conflict between the two pagination types. If you want to use full_numbers pagination
|
||||||
|
* ensure that you either have "example_alt_pagination" as a body class name, or better yet,
|
||||||
|
* modify that selector.
|
||||||
|
* Note that the path used for Images is relative. All images are by default located in
|
||||||
|
* ../images/ - relative to this CSS file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* jQuery UI specific styling
|
||||||
|
*/
|
||||||
|
|
||||||
|
.paging_two_button .ui-button {
|
||||||
|
float: left;
|
||||||
|
cursor: pointer;
|
||||||
|
* cursor: hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paging_full_numbers .ui-button {
|
||||||
|
padding: 2px 6px;
|
||||||
|
margin: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
* cursor: hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_paginate .ui-button {
|
||||||
|
margin-right: -0.1em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paging_full_numbers {
|
||||||
|
width: 350px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_wrapper .ui-toolbar {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.dataTables_wrapper .ui-toolbar input, selectbox{
|
||||||
|
margin:0px 7px;}
|
||||||
|
|
||||||
|
.dataTables_paginate {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_info {
|
||||||
|
padding-top: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display thead th {
|
||||||
|
padding: 3px 0px 3px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
* cursor: hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.dataTables_wrapper .ui-widget-header {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sort arrow icon positioning
|
||||||
|
*/
|
||||||
|
table.display thead th div.DataTables_sort_wrapper {
|
||||||
|
position: relative;
|
||||||
|
padding-right: 20px;
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display thead th div.DataTables_sort_wrapper span {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -8px;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* Everything below this line is the same as demo_table.css. This file is
|
||||||
|
* required for 'cleanliness' of the markup
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
* DataTables features
|
||||||
|
*/
|
||||||
|
|
||||||
|
.dataTables_wrapper {
|
||||||
|
position: relative;
|
||||||
|
min-height: 302px;
|
||||||
|
_height: 302px;
|
||||||
|
clear: both;
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_processing {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 50%;
|
||||||
|
width: 250px;
|
||||||
|
margin-left: -125px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 11px;
|
||||||
|
padding: 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_length {
|
||||||
|
width: 40%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_filter {
|
||||||
|
width: 50%;
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_info {
|
||||||
|
width: 50%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_paginate {
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pagination nested */
|
||||||
|
.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next {
|
||||||
|
height: 19px;
|
||||||
|
width: 19px;
|
||||||
|
margin-left: 3px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginate_disabled_previous {
|
||||||
|
background-image: url('../images/back_disabled.jpg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginate_enabled_previous {
|
||||||
|
background-image: url('../images/back_enabled.jpg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginate_disabled_next {
|
||||||
|
background-image: url('../images/forward_disabled.jpg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginate_enabled_next {
|
||||||
|
background-image: url('../images/forward_enabled.jpg');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
* DataTables display
|
||||||
|
*/
|
||||||
|
table.display {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 100%;
|
||||||
|
clear: both;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tfoot th {
|
||||||
|
padding: 3px 0px 3px 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.heading2 td {
|
||||||
|
border-bottom: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display td {
|
||||||
|
padding: 8px 10px;
|
||||||
|
font-size:12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display td.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
* DataTables sorting
|
||||||
|
*/
|
||||||
|
|
||||||
|
.sorting_asc {
|
||||||
|
background: url('../images/sort_asc.png') no-repeat center right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sorting_desc {
|
||||||
|
background: url('../images/sort_desc.png') no-repeat center right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sorting {
|
||||||
|
background: url('../images/sort_both.png') no-repeat center right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sorting_asc_disabled {
|
||||||
|
background: url('../images/sort_asc_disabled.png') no-repeat center right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sorting_desc_disabled {
|
||||||
|
background: url('../images/sort_desc_disabled.png') no-repeat center right;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
* DataTables row classes
|
||||||
|
*/
|
||||||
|
table.display tr.odd.gradeA {
|
||||||
|
background-color: #F8F8F8;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.even.gradeA {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
table.display tr.odd.gradeA {
|
||||||
|
background-color: #F8F8F8;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.even.gradeA {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.odd.gradeC {
|
||||||
|
background-color: #ddddff;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.even.gradeC {
|
||||||
|
background-color: #eeeeff;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.odd.gradeX {
|
||||||
|
background-color: #ffdddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.even.gradeX {
|
||||||
|
background-color: #ffeeee;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.odd.gradeU {
|
||||||
|
background-color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.even.gradeU {
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tr.odd {
|
||||||
|
background-color: #ECEDF1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
* Misc
|
||||||
|
*/
|
||||||
|
.dataTables_scroll {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top, .bottom {
|
||||||
|
padding: 15px;
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
border: 1px solid #CCCCCC;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top .dataTables_info {
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_empty {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
tfoot input {
|
||||||
|
margin: 0.5em 0;
|
||||||
|
width: 100%;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
tfoot input.search_init {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.group {
|
||||||
|
background-color: #d1cfd0;
|
||||||
|
border-bottom: 2px solid #A19B9E;
|
||||||
|
border-top: 2px solid #A19B9E;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.details {
|
||||||
|
background-color: #d1cfd0;
|
||||||
|
border: 2px solid #A19B9E;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.example_alt_pagination div.dataTables_info {
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paging_full_numbers span.paginate_button,
|
||||||
|
.paging_full_numbers span.paginate_active {
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
padding: 2px 5px;
|
||||||
|
margin: 0 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
*cursor: hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paging_full_numbers span.paginate_button {
|
||||||
|
background-color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paging_full_numbers span.paginate_button:hover {
|
||||||
|
background-color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paging_full_numbers span.paginate_active {
|
||||||
|
background-color: #99B3FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.even.row_selected td {
|
||||||
|
background-color: #B0BED9;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.display tr.odd.row_selected td {
|
||||||
|
background-color: #9FAFD1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sorting classes for columns
|
||||||
|
*/
|
||||||
|
/* For the standard odd/even */
|
||||||
|
tr.odd td.sorting_1 {
|
||||||
|
background-color: #ECEDF1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd td.sorting_2 {
|
||||||
|
background-color: #ECEDF1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd td.sorting_3 {
|
||||||
|
background-color: #ECEDF1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even td.sorting_1 {
|
||||||
|
background-color: #ECEDF1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even td.sorting_2 {
|
||||||
|
background-color: #ECEDF1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even td.sorting_3 {
|
||||||
|
background-color: #ECEDF1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* For the Conditional-CSS grading rows */
|
||||||
|
/*
|
||||||
|
Colour calculations (based off the main row colours)
|
||||||
|
Level 1:
|
||||||
|
dd > c4
|
||||||
|
ee > d5
|
||||||
|
Level 2:
|
||||||
|
dd > d1
|
||||||
|
ee > e2
|
||||||
|
*/
|
||||||
|
tr.odd.gradeA td.sorting_1 {
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeA td.sorting_2 {
|
||||||
|
background-color: #d1ffd1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeA td.sorting_3 {
|
||||||
|
background-color: #d1ffd1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeA td.sorting_1 {
|
||||||
|
background-color: #FBFBFB;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeA td.sorting_2 {
|
||||||
|
background-color: #e2ffe2;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeA td.sorting_3 {
|
||||||
|
background-color: #e2ffe2;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeC td.sorting_1 {
|
||||||
|
background-color: #c4c4ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeC td.sorting_2 {
|
||||||
|
background-color: #d1d1ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeC td.sorting_3 {
|
||||||
|
background-color: #d1d1ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeC td.sorting_1 {
|
||||||
|
background-color: #d5d5ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeC td.sorting_2 {
|
||||||
|
background-color: #e2e2ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeC td.sorting_3 {
|
||||||
|
background-color: #e2e2ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeX td.sorting_1 {
|
||||||
|
background-color: #ffc4c4;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeX td.sorting_2 {
|
||||||
|
background-color: #ffd1d1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeX td.sorting_3 {
|
||||||
|
background-color: #ffd1d1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeX td.sorting_1 {
|
||||||
|
background-color: #ffd5d5;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeX td.sorting_2 {
|
||||||
|
background-color: #ffe2e2;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeX td.sorting_3 {
|
||||||
|
background-color: #ffe2e2;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeU td.sorting_1 {
|
||||||
|
background-color: #c4c4c4;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeU td.sorting_2 {
|
||||||
|
background-color: #d1d1d1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.odd.gradeU td.sorting_3 {
|
||||||
|
background-color: #d1d1d1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeU td.sorting_1 {
|
||||||
|
background-color: #d5d5d5;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeU td.sorting_2 {
|
||||||
|
background-color: #e2e2e2;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.even.gradeU td.sorting_3 {
|
||||||
|
background-color: #e2e2e2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Row highlighting example
|
||||||
|
*/
|
||||||
|
.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted {
|
||||||
|
background-color: #ECFFB3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted {
|
||||||
|
background-color: #E6FF99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table td{
|
||||||
|
border:1px solid #ccc;}
|
||||||
|
.data-table tbody{
|
||||||
|
color:#555555;
|
||||||
|
border:1px solid #ccc;}
|
||||||
|
.data-table thead{
|
||||||
|
border-top:none;}
|
||||||
|
.dataTables_wrapper .ui-toolbar .ui-state-default {
|
||||||
|
color:#666;
|
||||||
|
border:1px solid #ccc;
|
||||||
|
border-radius:3px;
|
||||||
|
background:#fff;
|
||||||
|
font-weight:bold;
|
||||||
|
padding:3px 8px;
|
||||||
|
box-shadow:0px 1px 1px #EDEDED;
|
||||||
|
margin-left:4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_wrapper .ui-toolbar{
|
||||||
|
border:1px solid #ccc;
|
||||||
|
border-top:none;}
|
||||||
|
#myTable p{
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
}
|
29
admin/css/ie.css
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
.quick_search {
|
||||||
|
text-align: center;
|
||||||
|
padding: 14px 0 0px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick_search input[type=text] {
|
||||||
|
text-align: left;
|
||||||
|
height: 22px;
|
||||||
|
width: 88%;
|
||||||
|
color: #ccc;
|
||||||
|
padding-left: 2%;
|
||||||
|
padding-top: 5px;
|
||||||
|
background: #fff url(../images/icn_search.png) no-repeat;
|
||||||
|
background-position: 10px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggleLink {
|
||||||
|
display: inline;
|
||||||
|
float: none;
|
||||||
|
margin-left: 2%
|
||||||
|
}
|
||||||
|
|
||||||
|
html ul.tabs li.active, html ul.tabs li.active a:hover {
|
||||||
|
background: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=submit].btn_post_message {
|
||||||
|
background: url(../images/post_message.png) no-repeat;
|
||||||
|
}
|
BIN
admin/css/images/Thumbs.db
Normal file
BIN
admin/css/images/datepicker-bg.png
Normal file
After Width: | Height: | Size: 807 B |
BIN
admin/css/images/ui-bg_flat_0_aaaaaa_40x100.png
Normal file
After Width: | Height: | Size: 180 B |
BIN
admin/css/images/ui-bg_flat_75_ffffff_40x100.png
Normal file
After Width: | Height: | Size: 178 B |
BIN
admin/css/images/ui-bg_glass_55_fbf9ee_1x400.png
Normal file
After Width: | Height: | Size: 120 B |
BIN
admin/css/images/ui-bg_glass_65_ffffff_1x400.png
Normal file
After Width: | Height: | Size: 105 B |
BIN
admin/css/images/ui-bg_glass_75_dadada_1x400.png
Normal file
After Width: | Height: | Size: 111 B |
BIN
admin/css/images/ui-bg_glass_75_e6e6e6_1+ù4030.png
Normal file
After Width: | Height: | Size: 110 B |
BIN
admin/css/images/ui-bg_glass_75_e6e6e6_1x400.png
Normal file
After Width: | Height: | Size: 110 B |
BIN
admin/css/images/ui-bg_glass_95_fef1ec_1x400.png
Normal file
After Width: | Height: | Size: 119 B |
BIN
admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
Normal file
After Width: | Height: | Size: 249 B |
BIN
admin/css/images/ui-icons_222222_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
admin/css/images/ui-icons_2e83ff_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
admin/css/images/ui-icons_454545_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
admin/css/images/ui-icons_888888_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
admin/css/images/ui-icons_cd0a0a_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
11
admin/css/jquery-ui.css
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/*
|
||||||
|
* jQuery UI CSS Framework 1.8.17
|
||||||
|
*
|
||||||
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Theming
|
||||||
|
*/
|
||||||
|
@import "jquery.ui/jquery.ui.base.css";
|
||||||
|
@import "jquery.ui/jquery.ui.theme.css";
|
38
admin/css/jquery.ui.core.css
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* jQuery UI CSS Framework 1.8.17
|
||||||
|
*
|
||||||
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Theming/API
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Layout helpers
|
||||||
|
----------------------------------*/
|
||||||
|
.ui-helper-hidden { display: none; }
|
||||||
|
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
|
||||||
|
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
||||||
|
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
|
||||||
|
.ui-helper-clearfix:after { clear: both; }
|
||||||
|
.ui-helper-clearfix { zoom: 1; }
|
||||||
|
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||||
|
|
||||||
|
|
||||||
|
/* Interaction Cues
|
||||||
|
----------------------------------*/
|
||||||
|
.ui-state-disabled { cursor: default !important; }
|
||||||
|
|
||||||
|
|
||||||
|
/* Icons
|
||||||
|
----------------------------------*/
|
||||||
|
|
||||||
|
/* states and images */
|
||||||
|
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||||
|
|
||||||
|
|
||||||
|
/* Misc visuals
|
||||||
|
----------------------------------*/
|
||||||
|
|
||||||
|
/* Overlays */
|
||||||
|
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
68
admin/css/jquery.ui.datepicker.css
vendored
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
/*
|
||||||
|
* jQuery UI Datepicker 1.8.17
|
||||||
|
*
|
||||||
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Datepicker#theming
|
||||||
|
*/
|
||||||
|
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none;box-shadow:0px 2px 15px 1px #ccc; }
|
||||||
|
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0;background:#ccc; color:#333; border:1px solid #999;}
|
||||||
|
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||||
|
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||||
|
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||||
|
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||||
|
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||||
|
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||||
|
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||||
|
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||||
|
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||||
|
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||||
|
.ui-datepicker select.ui-datepicker-month,
|
||||||
|
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||||
|
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||||
|
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||||
|
.ui-datepicker td { border: 0; padding: 1px; }
|
||||||
|
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .4em; text-align: right; text-decoration: none; border-radius:8px;}
|
||||||
|
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||||
|
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||||
|
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||||
|
|
||||||
|
/* with multiple calendars */
|
||||||
|
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||||
|
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||||
|
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||||
|
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||||
|
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||||
|
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||||
|
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||||
|
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||||
|
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||||
|
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
||||||
|
|
||||||
|
/* RTL support */
|
||||||
|
.ui-datepicker-rtl { direction: rtl; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||||
|
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||||
|
|
||||||
|
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||||
|
.ui-datepicker-cover {
|
||||||
|
display: none; /*sorry for IE5*/
|
||||||
|
display/**/: block; /*sorry for IE5*/
|
||||||
|
position: absolute; /*must have*/
|
||||||
|
z-index: -1; /*must have*/
|
||||||
|
filter: mask(); /*must have*/
|
||||||
|
top: -4px; /*must have*/
|
||||||
|
left: -4px; /*must have*/
|
||||||
|
width: 200px; /*must have*/
|
||||||
|
height: 200px; /*must have*/
|
||||||
|
}
|
242
admin/css/jquery.ui.theme.css
vendored
Normal file
|
@ -0,0 +1,242 @@
|
||||||
|
/*
|
||||||
|
* jQuery UI CSS Framework 1.8.17
|
||||||
|
*
|
||||||
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Theming/API
|
||||||
|
*
|
||||||
|
* To view and modify this theme, visit http://jqueryui.com/themeroller/
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Component containers
|
||||||
|
----------------------------------*/
|
||||||
|
.ui-widget { font-family:/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
|
||||||
|
.ui-widget .ui-widget { font-size: 1em; }
|
||||||
|
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
|
||||||
|
.ui-widget-content { border: 1px solid #ccc/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
|
||||||
|
.ui-widget-content a { color: #222222/*{fcContent}*/; }
|
||||||
|
.ui-widget-header { border: 1px solid #CBDAE8/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
|
||||||
|
.ui-widget-header a { color: #222222/*{fcHeader}*/; }
|
||||||
|
|
||||||
|
/* Interaction states
|
||||||
|
----------------------------------*/
|
||||||
|
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #ccc/*{borderColorDefault}*/; background: #fff/*{bgColorDefault}*/ /*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: bold/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }
|
||||||
|
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; }
|
||||||
|
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; }
|
||||||
|
.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; }
|
||||||
|
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; }
|
||||||
|
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; }
|
||||||
|
.ui-widget :active { outline: none; }
|
||||||
|
|
||||||
|
/* Interaction Cues
|
||||||
|
----------------------------------*/
|
||||||
|
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #999/*{borderColorHighlight}*/; background: #CCCCCC /*{bgColorHighlight}*/ /*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
|
||||||
|
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
|
||||||
|
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid red/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
|
||||||
|
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
|
||||||
|
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
|
||||||
|
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||||
|
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||||
|
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||||
|
|
||||||
|
/* Icons
|
||||||
|
----------------------------------*/
|
||||||
|
|
||||||
|
/* states and images */
|
||||||
|
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
|
||||||
|
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
|
||||||
|
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
|
||||||
|
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
|
||||||
|
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }
|
||||||
|
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
|
||||||
|
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
|
||||||
|
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
|
||||||
|
|
||||||
|
/* positioning */
|
||||||
|
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||||
|
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||||
|
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||||
|
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||||
|
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||||
|
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||||
|
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||||
|
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||||
|
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||||
|
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||||
|
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||||
|
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||||
|
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||||
|
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||||
|
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||||
|
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||||
|
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||||
|
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||||
|
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||||
|
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||||
|
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||||
|
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||||
|
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||||
|
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||||
|
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||||
|
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||||
|
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||||
|
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||||
|
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||||
|
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||||
|
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||||
|
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||||
|
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||||
|
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||||
|
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||||
|
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||||
|
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||||
|
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||||
|
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||||
|
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||||
|
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||||
|
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||||
|
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||||
|
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||||
|
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||||
|
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||||
|
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||||
|
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||||
|
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||||
|
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||||
|
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||||
|
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||||
|
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||||
|
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||||
|
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||||
|
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||||
|
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||||
|
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||||
|
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||||
|
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||||
|
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||||
|
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||||
|
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||||
|
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||||
|
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||||
|
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||||
|
.ui-icon-extlink { background-position: -32px -80px; }
|
||||||
|
.ui-icon-newwin { background-position: -48px -80px; }
|
||||||
|
.ui-icon-refresh { background-position: -64px -80px; }
|
||||||
|
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||||
|
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||||
|
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||||
|
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||||
|
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||||
|
.ui-icon-document { background-position: -32px -96px; }
|
||||||
|
.ui-icon-document-b { background-position: -48px -96px; }
|
||||||
|
.ui-icon-note { background-position: -64px -96px; }
|
||||||
|
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||||
|
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||||
|
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||||
|
.ui-icon-comment { background-position: -128px -96px; }
|
||||||
|
.ui-icon-person { background-position: -144px -96px; }
|
||||||
|
.ui-icon-print { background-position: -160px -96px; }
|
||||||
|
.ui-icon-trash { background-position: -176px -96px; }
|
||||||
|
.ui-icon-locked { background-position: -192px -96px; }
|
||||||
|
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||||
|
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||||
|
.ui-icon-tag { background-position: -240px -96px; }
|
||||||
|
.ui-icon-home { background-position: 0 -112px; }
|
||||||
|
.ui-icon-flag { background-position: -16px -112px; }
|
||||||
|
.ui-icon-calendar { background-position: -32px -112px; }
|
||||||
|
.ui-icon-cart { background-position: -48px -112px; }
|
||||||
|
.ui-icon-pencil { background-position: -64px -112px; }
|
||||||
|
.ui-icon-clock { background-position: -80px -112px; }
|
||||||
|
.ui-icon-disk { background-position: -96px -112px; }
|
||||||
|
.ui-icon-calculator { background-position: -112px -112px; }
|
||||||
|
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||||
|
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||||
|
.ui-icon-search { background-position: -160px -112px; }
|
||||||
|
.ui-icon-wrench { background-position: -176px -112px; }
|
||||||
|
.ui-icon-gear { background-position: -192px -112px; }
|
||||||
|
.ui-icon-heart { background-position: -208px -112px; }
|
||||||
|
.ui-icon-star { background-position: -224px -112px; }
|
||||||
|
.ui-icon-link { background-position: -240px -112px; }
|
||||||
|
.ui-icon-cancel { background-position: 0 -128px; }
|
||||||
|
.ui-icon-plus { background-position: -16px -128px; }
|
||||||
|
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||||
|
.ui-icon-minus { background-position: -48px -128px; }
|
||||||
|
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||||
|
.ui-icon-close { background-position: -80px -128px; }
|
||||||
|
.ui-icon-closethick { background-position: -96px -128px; }
|
||||||
|
.ui-icon-key { background-position: -112px -128px; }
|
||||||
|
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||||
|
.ui-icon-scissors { background-position: -144px -128px; }
|
||||||
|
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||||
|
.ui-icon-copy { background-position: -176px -128px; }
|
||||||
|
.ui-icon-contact { background-position: -192px -128px; }
|
||||||
|
.ui-icon-image { background-position: -208px -128px; }
|
||||||
|
.ui-icon-video { background-position: -224px -128px; }
|
||||||
|
.ui-icon-script { background-position: -240px -128px; }
|
||||||
|
.ui-icon-alert { background-position: 0 -144px; }
|
||||||
|
.ui-icon-info { background-position: -16px -144px; }
|
||||||
|
.ui-icon-notice { background-position: -32px -144px; }
|
||||||
|
.ui-icon-help { background-position: -48px -144px; }
|
||||||
|
.ui-icon-check { background-position: -64px -144px; }
|
||||||
|
.ui-icon-bullet { background-position: -80px -144px; }
|
||||||
|
.ui-icon-radio-off { background-position: -96px -144px; }
|
||||||
|
.ui-icon-radio-on { background-position: -112px -144px; }
|
||||||
|
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||||
|
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||||
|
.ui-icon-play { background-position: 0 -160px; }
|
||||||
|
.ui-icon-pause { background-position: -16px -160px; }
|
||||||
|
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||||
|
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||||
|
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||||
|
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||||
|
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||||
|
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||||
|
.ui-icon-stop { background-position: -96px -160px; }
|
||||||
|
.ui-icon-eject { background-position: -112px -160px; }
|
||||||
|
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||||
|
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||||
|
.ui-icon-power { background-position: 0 -176px; }
|
||||||
|
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||||
|
.ui-icon-signal { background-position: -32px -176px; }
|
||||||
|
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||||
|
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||||
|
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||||
|
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||||
|
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||||
|
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||||
|
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||||
|
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||||
|
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||||
|
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||||
|
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||||
|
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||||
|
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||||
|
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||||
|
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||||
|
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||||
|
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||||
|
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||||
|
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||||
|
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||||
|
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||||
|
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||||
|
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||||
|
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||||
|
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||||
|
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||||
|
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||||
|
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||||
|
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||||
|
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||||
|
|
||||||
|
|
||||||
|
/* Misc visuals
|
||||||
|
----------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Overlays */
|
||||||
|
.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
|
||||||
|
.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
|
945
admin/css/layout.css
Normal file
|
@ -0,0 +1,945 @@
|
||||||
|
html, div, map, dt, isindex, form, header, aside, section, section, article, footer {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif;
|
||||||
|
background: #F8F8F8;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spacer {
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link, a:visited {
|
||||||
|
color: #77BACE;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Header */
|
||||||
|
|
||||||
|
header#header {
|
||||||
|
height: 55px;
|
||||||
|
width: 100%;
|
||||||
|
background: #222222 url(../images/header_bg.png) repeat-x;
|
||||||
|
}
|
||||||
|
|
||||||
|
header#header h1.site_title, header#header h2.section_title {
|
||||||
|
float: left;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 22px;
|
||||||
|
display: block;
|
||||||
|
width: 23%;
|
||||||
|
height: 55px;
|
||||||
|
font-weight: normal;
|
||||||
|
text-align: left;
|
||||||
|
text-indent: 1.8%;
|
||||||
|
line-height: 55px;
|
||||||
|
color: #fff;
|
||||||
|
text-shadow: 0 -1px 0 #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
header#header h1.site_title a {
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
header#header h2.section_title {
|
||||||
|
text-align: center;
|
||||||
|
text-indent: -76.5%;
|
||||||
|
width: 68%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn_view_site {
|
||||||
|
float: left;
|
||||||
|
width: 9%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn_view_site a {
|
||||||
|
display: block;
|
||||||
|
margin-top: 12px;
|
||||||
|
width: 91px;
|
||||||
|
height: 27px;
|
||||||
|
background: url(../images/btn_view_site.png) no-repeat;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 29px;
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
text-shadow: 0 -1px 0 #000;}
|
||||||
|
|
||||||
|
.btn_view_site a:hover {
|
||||||
|
background-position: 0 -27px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Secondary Header Bar */
|
||||||
|
|
||||||
|
section#secondary_bar {
|
||||||
|
height: 38px;
|
||||||
|
width: 100%;
|
||||||
|
background: #F1F1F4 url(../images/secondary_bar.png) repeat-x;
|
||||||
|
}
|
||||||
|
|
||||||
|
section#secondary_bar .user {
|
||||||
|
float: left;
|
||||||
|
width: 23%;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user p {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
color: #666666;
|
||||||
|
font-weight: bold;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
width: 85%;
|
||||||
|
height: 35px;
|
||||||
|
line-height: 35px;
|
||||||
|
text-indent: 25px;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
background: url(../images/icn_user.png) no-repeat center left;
|
||||||
|
margin-left: 6%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #666666}
|
||||||
|
|
||||||
|
.user a:hover {
|
||||||
|
color: #77BACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user a.logout_user {
|
||||||
|
float: left;
|
||||||
|
display: block;
|
||||||
|
width: 16px;
|
||||||
|
height: 35px;
|
||||||
|
text-indent: -5000px;
|
||||||
|
background: url(../images/icn_logout.png) center no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Breadcrumbs */
|
||||||
|
|
||||||
|
section#secondary_bar .breadcrumbs_container {
|
||||||
|
float: left;
|
||||||
|
width: 77%;
|
||||||
|
background: url(../images/secondary_bar_shadow.png) no-repeat left top;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
article.breadcrumbs {
|
||||||
|
float: left;
|
||||||
|
padding: 0 10px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
-webkit-box-shadow: 0 1px 0 #fff;
|
||||||
|
-moz-box-shadow: 0 1px 0 #fff;
|
||||||
|
box-shadow: 0 1px 0 #fff;
|
||||||
|
height: 23px;
|
||||||
|
margin: 4px 3%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumbs a {
|
||||||
|
display: inline-block;
|
||||||
|
float: left;
|
||||||
|
height: 24px;
|
||||||
|
line-height: 23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumbs a.current, .breadcrumbs a.current:hover {
|
||||||
|
color: #9E9E9E;
|
||||||
|
font-weight: bold;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumbs a:link, .breadcrumbs a:visited {
|
||||||
|
color: #44474F;
|
||||||
|
text-decoration: none;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
font-weight: bold;}
|
||||||
|
|
||||||
|
.breadcrumbs a:hover {
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb_divider {
|
||||||
|
display: inline-block;
|
||||||
|
width: 12px;
|
||||||
|
height: 24px;
|
||||||
|
background: url(../images/breadcrumb_divider.png) no-repeat;
|
||||||
|
float: left;
|
||||||
|
margin: 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sidebar */
|
||||||
|
|
||||||
|
aside#sidebar {
|
||||||
|
width: 23%;
|
||||||
|
background: #E0E0E3 url(../images/sidebar.png) repeat;
|
||||||
|
float: left;
|
||||||
|
height: 870px;
|
||||||
|
margin-top: -4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar hr {
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
background: url(../images/sidebar_divider.png) repeat-x;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 2px;}
|
||||||
|
|
||||||
|
|
||||||
|
/* Search */
|
||||||
|
|
||||||
|
.quick_search {
|
||||||
|
text-align: center;
|
||||||
|
padding: 14px 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick_search input[type=text] {
|
||||||
|
-webkit-border-radius: 20px;
|
||||||
|
-moz-border-radius: 20px;
|
||||||
|
border-radius: 20px;
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
height: 26px;
|
||||||
|
width: 90%;
|
||||||
|
color: #ccc;
|
||||||
|
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
text-indent: 30px;
|
||||||
|
background: #fff url(../images/icn_search.png) no-repeat;
|
||||||
|
background-position: 10px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick_search input[type=text]:focus {
|
||||||
|
outline: none;
|
||||||
|
color: #666666;
|
||||||
|
border: 1px solid #77BACE;
|
||||||
|
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
-moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sidebar Menu */
|
||||||
|
|
||||||
|
#sidebar h3 {
|
||||||
|
background:url("../images/secondary_bar.png") repeat-x scroll 0 0 #F1F1F4;
|
||||||
|
color: #1F1F20;
|
||||||
|
text-transform: uppercase;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
width: 94%;
|
||||||
|
float: left;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: bold;
|
||||||
|
height: 28px;
|
||||||
|
margin: 0 0 5px;
|
||||||
|
padding: 7px 0 0 15px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar ul, .width_quarter ul{
|
||||||
|
clear: both;
|
||||||
|
margin: 10px 0 10px 0; padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar li, .width_quarter li{
|
||||||
|
list-style: none;
|
||||||
|
margin: 0 0 0 25px; padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar li a, .width_quarter li a{
|
||||||
|
color: #666666;
|
||||||
|
padding-left: 25px;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
height: 17px;
|
||||||
|
line-height: 17px;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
margin: 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar li a:hover, .width_quarter li a:hover {
|
||||||
|
color: #444444;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sidebar Icons */
|
||||||
|
|
||||||
|
li.icn_new_article a {
|
||||||
|
background: url(../images/icn_new_article.png) no-repeat center left;
|
||||||
|
line-height:20px;
|
||||||
|
}
|
||||||
|
li.icn_edit_article a{
|
||||||
|
background: url(../images/icn_edit_article.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_view a{
|
||||||
|
background: url(../images/view.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_categories a {
|
||||||
|
background: url(../images/icn_categories.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_tags a {
|
||||||
|
background: url(../images/icn_tags.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_add_user a {
|
||||||
|
background: url(../images/icn_add_user.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_view_users a {
|
||||||
|
background: url(../images/icn_view_users.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_profile a {
|
||||||
|
background: url(../images/icn_profile.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_folder a {
|
||||||
|
background: url(../images/icn_folder.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_photo a {
|
||||||
|
background: url(../images/icn_photo.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_audio a {
|
||||||
|
background: url(../images/icn_audio.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_video a {
|
||||||
|
background: url(../images/icn_video.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_settings a {
|
||||||
|
background: url(../images/icn_settings.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_security a {
|
||||||
|
background: url(../images/icn_security.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
li.icn_jump_back a {
|
||||||
|
background: url(../images/icn_jump_back.png) no-repeat center left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar p {
|
||||||
|
color: #666666;
|
||||||
|
padding-left: 6%;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
margin: 10px 0 0 0;}
|
||||||
|
|
||||||
|
#sidebar a {
|
||||||
|
color: #666666;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar footer {
|
||||||
|
margin-top: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Main Content */
|
||||||
|
|
||||||
|
|
||||||
|
section#main {
|
||||||
|
width: 77%;
|
||||||
|
background: url(../images/sidebar_shadow.png) repeat-y left top;
|
||||||
|
float: left;
|
||||||
|
margin-top: -2px;
|
||||||
|
height:870px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main h3 {
|
||||||
|
color: #1F1F20;
|
||||||
|
text-transform: uppercase;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
font-size: 13px;
|
||||||
|
margin: 8px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Modules */
|
||||||
|
|
||||||
|
.module {
|
||||||
|
border: 1px solid #9BA0AF;
|
||||||
|
width: 100%;
|
||||||
|
margin: 20px 3% 0 3%;
|
||||||
|
margin-top: 20px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .module header h3 {
|
||||||
|
display: block;
|
||||||
|
width: 90%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.module header {
|
||||||
|
height: 38px;
|
||||||
|
width: 100%;
|
||||||
|
background: #F1F1F4 url(../images/secondary_bar.png) repeat-x;
|
||||||
|
-webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;
|
||||||
|
-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
|
||||||
|
border-top-left-radius: 5px; border-top-right-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.module footer {
|
||||||
|
height: 32px;
|
||||||
|
width: 100%;
|
||||||
|
border-top: 1px solid #9CA1B0;
|
||||||
|
background: #F1F1F4 url(../images/module_footer_bg.png) repeat-x;
|
||||||
|
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px;
|
||||||
|
-moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomright: 5px;
|
||||||
|
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.module_content {
|
||||||
|
margin: 10px 20px;
|
||||||
|
color: #666;}
|
||||||
|
|
||||||
|
/* Module Widths */
|
||||||
|
|
||||||
|
.width_full {
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width_half {
|
||||||
|
width: 46%;
|
||||||
|
margin-right: 0;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width_quarter {
|
||||||
|
width: 26%;
|
||||||
|
margin-right: 0;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width_3_quarter {
|
||||||
|
width: 66%;
|
||||||
|
margin-right: 0;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stats Module */
|
||||||
|
|
||||||
|
.stats_graph {
|
||||||
|
width: 64%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats_overview {
|
||||||
|
background: #F6F6F6;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
float: right;
|
||||||
|
width: 26%;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overview_today, .overview_previous {
|
||||||
|
width: 50%;
|
||||||
|
float: left;}
|
||||||
|
|
||||||
|
.stats_overview p {
|
||||||
|
margin: 0; padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
text-transform: uppercase;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats_overview p.overview_day {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 6px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats_overview p.overview_count {
|
||||||
|
font-size: 26px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333333;}
|
||||||
|
|
||||||
|
.stats_overview p.overview_type {
|
||||||
|
font-size: 10px;
|
||||||
|
color: #999999;
|
||||||
|
margin-bottom: 8px}
|
||||||
|
|
||||||
|
/* Content Manager */
|
||||||
|
|
||||||
|
.tablesorter {
|
||||||
|
width: 100%;
|
||||||
|
margin: -5px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablesorter td{
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border-bottom: 1px dotted #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablesorter thead tr {
|
||||||
|
height: 34px;
|
||||||
|
background: url(../images/table_sorter_header.png) repeat-x;
|
||||||
|
text-align: left;
|
||||||
|
text-indent: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablesorter td {
|
||||||
|
padding: 15px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablesorter input[type=image] {
|
||||||
|
margin-right: 10px;}
|
||||||
|
|
||||||
|
ul.tabs {
|
||||||
|
margin: 3px 10px 0 0;
|
||||||
|
padding: 0;
|
||||||
|
float: right;
|
||||||
|
list-style: none;
|
||||||
|
height: 24px; /*--Set height of tabs--*/
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
-webkit-box-shadow: 0 1px 0 #fff;
|
||||||
|
-moz-box-shadow: 0 1px 0 #fff;
|
||||||
|
box-shadow: 0 1px 0 #fff;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-weight: bold;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
}
|
||||||
|
ul.tabs li {
|
||||||
|
float: left;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
ul.tabs li a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #999;
|
||||||
|
display: block;
|
||||||
|
padding: 0 10px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.tabs li a:hover {
|
||||||
|
color: #44474F;
|
||||||
|
}
|
||||||
|
|
||||||
|
html ul.tabs li.active a {
|
||||||
|
color: #44474F;
|
||||||
|
}
|
||||||
|
|
||||||
|
html ul.tabs li.active, html ul.tabs li.active a:hover {
|
||||||
|
background: #F1F2F4;
|
||||||
|
-webkit-box-shadow: inset 0 2px 3px #818181;
|
||||||
|
-moz-box-shadow: inset 0 2px 3px #818181;
|
||||||
|
box-shadow: inset 0 2px 3px #818181;
|
||||||
|
}
|
||||||
|
|
||||||
|
html ul.tabs li:first-child, html ul.tabs li:first-child a {
|
||||||
|
-webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px;
|
||||||
|
-moz-border-radius-topleft: 5px; -moz-border-radius-bottomleft: 5px;
|
||||||
|
border-top-left-radius: 5px; border-bottom-left-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
html ul.tabs li:last-child, html ul.tabs li:last-child a {
|
||||||
|
-webkit-border-top-right-radius: 5px; -webkit-border-bottom-right-radius: 5px;
|
||||||
|
-moz-border-radius-topright: 5px; -moz-border-radius-bottomright: 5px;
|
||||||
|
border-top-right-radius: 5px; border-bottom-right-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .module header h3.tabs_involved {
|
||||||
|
display: block;
|
||||||
|
width: 60%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Messages */
|
||||||
|
|
||||||
|
.message {
|
||||||
|
border-bottom: 1px dotted #cccccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="submit"],input[type="button"] {
|
||||||
|
font-weight:bold;
|
||||||
|
background: #eee; /* Old browsers */
|
||||||
|
background: -moz-linear-gradient(top, rgba(255,255,255,.2) 0%, rgba(0,0,0,.2) 100%); /* FF3.6+ */
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.2)), color-stop(100%,rgba(0,0,0,.2))); /* Chrome,Safari4+ */
|
||||||
|
background: -webkit-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* Chrome10+,Safari5.1+ */
|
||||||
|
background: -o-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* Opera11.10+ */
|
||||||
|
background: -ms-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* IE10+ */
|
||||||
|
background: linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* W3C */
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-top: 1px solid #ccc;
|
||||||
|
border-left: 1px solid #ccc;
|
||||||
|
padding: 4px 12px;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
|
color: #444;
|
||||||
|
display: inline-block;
|
||||||
|
/*font-size: 11px; /* DISABLED FOR easydropdown */
|
||||||
|
/*font-weight: bold; /* DISABLED FOR easydropdown */
|
||||||
|
text-decoration: none;
|
||||||
|
text-shadow: 0 1px rgba(255, 255, 255, .75);
|
||||||
|
cursor: pointer;
|
||||||
|
line-height: 21px;
|
||||||
|
font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
float:left;
|
||||||
|
margin:10px 0 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="submit"]:hover, input[type="button"]:hover {
|
||||||
|
color: #222;
|
||||||
|
background: #ddd; /* Old browsers */
|
||||||
|
background: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); /* FF3.6+ */
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.3)), color-stop(100%,rgba(0,0,0,.3))); /* Chrome,Safari4+ */
|
||||||
|
background: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* Chrome10+,Safari5.1+ */
|
||||||
|
background: -o-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* Opera11.10+ */
|
||||||
|
background: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* IE10+ */
|
||||||
|
background: linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* W3C */
|
||||||
|
border: 1px solid #888;
|
||||||
|
border-top: 1px solid #aaa;
|
||||||
|
border-left: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=submit].alt_btn {
|
||||||
|
background: #D0D1D4 url(../images/btn_submit_2.png) repeat-x;
|
||||||
|
border: 1px solid#30B0C8;
|
||||||
|
-webkit-box-shadow: 0 1px 0 #fff;
|
||||||
|
-moz-box-shadow: 0 1px 0 #fff;
|
||||||
|
box-shadow: 0 1px 0 #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
height: 22px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 0 10px;
|
||||||
|
color: #003E49;
|
||||||
|
text-shadow: 0 1px 0 #6CDCF9;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=submit].alt_btn:hover {
|
||||||
|
color: #001217;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=submit].btn_post_message {
|
||||||
|
background: #D0D1D4 url(../images/post_message.png) no-repeat;
|
||||||
|
display: block;
|
||||||
|
width: 37px;
|
||||||
|
border: none;
|
||||||
|
height: 24px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-indent: -5000px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=submit].btn_post_message:hover {
|
||||||
|
background-position: 0 -24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post_message {
|
||||||
|
text-align: left;
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post_message input[type=text] {
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
height: 20px;
|
||||||
|
width: 70%;
|
||||||
|
color: #ccc;
|
||||||
|
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
text-indent: 10px;
|
||||||
|
background-position: 10px 6px;
|
||||||
|
float: left;
|
||||||
|
margin: 0 3.5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post_message input[type=text]:focus {
|
||||||
|
outline: none;
|
||||||
|
border: 1px solid #77BACE;
|
||||||
|
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
-moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post_message input[type=image] {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message_list {
|
||||||
|
height: 250px;
|
||||||
|
overflow-x:hidden;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* New/Edit Article Module */
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #F6F6F6;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 1% 0%;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset label {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
width: 96%;
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
padding-left: 10px;
|
||||||
|
margin: 5px 0 5px 0;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset input[type=text], fieldset input[type=password] {
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid #BBBBBB;
|
||||||
|
height: 25px;
|
||||||
|
color: #666666;
|
||||||
|
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
padding-left: 10px;
|
||||||
|
background-position: 10px 6px;
|
||||||
|
margin: 0;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
width: 92%;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
fieldset .datepicker-input {
|
||||||
|
background: url("images/datepicker-bg.png") repeat-x scroll right top #FFFFFF !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset input[type=file] {
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #666666;
|
||||||
|
border: 1px solid #BBBBBB;
|
||||||
|
background-position: 10px 6px;
|
||||||
|
margin: 0;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
margin: 0 10px;
|
||||||
|
height:25px;
|
||||||
|
}
|
||||||
|
fieldset input[type=text]:focus {
|
||||||
|
outline: none;
|
||||||
|
border: 1px solid #77BACE;
|
||||||
|
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
-moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset select {
|
||||||
|
width: 96%;
|
||||||
|
margin: 0 10px;
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
height: 20px;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset textarea {
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid #BBBBBB;
|
||||||
|
color: #666666;
|
||||||
|
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
|
||||||
|
padding-left: 10px;
|
||||||
|
background-position: 10px 6px;
|
||||||
|
margin: 0 0.5%;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
width: 96%;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset textarea:focus {
|
||||||
|
outline: none;
|
||||||
|
border: 1px solid #77BACE;
|
||||||
|
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
-moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit_link {
|
||||||
|
float: right;
|
||||||
|
margin-right: 3%;
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit_link select {
|
||||||
|
width: 150px;
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
height: 20px;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .module_content h1 {
|
||||||
|
color: #333333;
|
||||||
|
text-transform: none;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
font-size: 22px;
|
||||||
|
margin: 8px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .module_content h2 {
|
||||||
|
color: #444444;
|
||||||
|
text-transform: none;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
font-size: 18px;
|
||||||
|
margin: 8px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .module_content h3 {
|
||||||
|
color: #666666;
|
||||||
|
text-transform: uppercase;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
font-size: 13px;
|
||||||
|
margin: 8px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .module_content h4 {
|
||||||
|
color: #666666;
|
||||||
|
text-transform: none;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
font-size: 13px;
|
||||||
|
margin: 8px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .module_content li {
|
||||||
|
line-height: 150%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Alerts */
|
||||||
|
|
||||||
|
#main h4.alert_info {
|
||||||
|
display: block;
|
||||||
|
width: 95%;
|
||||||
|
margin: 20px 3% 0 3%;
|
||||||
|
margin-top: 20px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #B5E5EF url(../images/icn_alert_info.png) no-repeat;
|
||||||
|
background-position: 10px 10px;
|
||||||
|
border: 1px solid #77BACE;
|
||||||
|
color: #082B33;
|
||||||
|
padding: 10px 0;
|
||||||
|
text-indent: 40px;
|
||||||
|
font-size: 14px;}
|
||||||
|
|
||||||
|
#main h4.alert_warning {
|
||||||
|
display: block;
|
||||||
|
width: 95%;
|
||||||
|
margin: 20px 3% 0 3%;
|
||||||
|
margin-top: 20px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #F5F3BA url(../images/icn_alert_warning.png) no-repeat;
|
||||||
|
background-position: 10px 10px;
|
||||||
|
border: 1px solid #C7A20D;
|
||||||
|
color: #796616;
|
||||||
|
padding: 10px 0;
|
||||||
|
text-indent: 40px;
|
||||||
|
font-size: 14px;}
|
||||||
|
|
||||||
|
#main h4.alert_error {
|
||||||
|
display: block;
|
||||||
|
width: 95%;
|
||||||
|
margin: 20px 3% 0 3%;
|
||||||
|
margin-top: 20px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #F3D9D9 url(../images/icn_alert_error.png) no-repeat;
|
||||||
|
background-position: 10px 10px;
|
||||||
|
border: 1px solid #D20009;
|
||||||
|
color: #7B040F;
|
||||||
|
padding: 10px 0;
|
||||||
|
text-indent: 40px;
|
||||||
|
font-size: 14px;}
|
||||||
|
|
||||||
|
#main h4.alert_success {
|
||||||
|
display: block;
|
||||||
|
width: 95%;
|
||||||
|
margin: 20px 3% 0 3%;
|
||||||
|
margin-top: 20px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #E2F6C5 url(../images/icn_alert_success.png) no-repeat;
|
||||||
|
background-position: 10px 10px;
|
||||||
|
border: 1px solid #79C20D;
|
||||||
|
color: #32510F;
|
||||||
|
padding: 10px 0;
|
||||||
|
text-indent: 40px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.toggle{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.trigger{
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
.width_quarter li{
|
||||||
|
line-height:230%;
|
||||||
|
}
|
||||||
|
|
||||||
|
label.error {
|
||||||
|
display:block;
|
||||||
|
color:#B70000;
|
||||||
|
font-size:11px;
|
||||||
|
font-family:"Comic Sans MS", cursive;
|
||||||
|
font-weight:normal;
|
||||||
|
text-transform:capitalize;
|
||||||
|
margin-top:0;
|
||||||
|
margin-bottom:0;
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
input.error{ border: 1px solid #F00 !important;}
|
||||||
|
select.error{ border: 1px solid #F00 !important;}
|
||||||
|
textarea.error{ border: 1px solid #F00 !important;}
|
||||||
|
img {
|
||||||
|
border:0;
|
||||||
|
}
|
||||||
|
.tinyMCE{
|
||||||
|
float:left;
|
||||||
|
width:99%;
|
||||||
|
padding-left:10px;
|
||||||
|
}
|
101
admin/css/login.css
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
body{
|
||||||
|
font-family:"Trebuchet MS","Myriad Pro",Arial,sans-serif;
|
||||||
|
}
|
||||||
|
.loginform{
|
||||||
|
width:360px;
|
||||||
|
margin:0px auto;
|
||||||
|
margin-top: 140px;
|
||||||
|
box-shadow:0px 4px 90px #EEEEEE;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
background:url(../images/login-title.png) no-repeat;
|
||||||
|
text-align:center;
|
||||||
|
height:69px;
|
||||||
|
}
|
||||||
|
.form_wrapper{
|
||||||
|
padding:23px 29px 40px 29px;
|
||||||
|
background:url(../images/login-form-body-bg.png) repeat-x bottom;}
|
||||||
|
#password{
|
||||||
|
border:none;
|
||||||
|
font:19px Arial, Helvetica, sans-serif;
|
||||||
|
color:#ccc;
|
||||||
|
width:250px;
|
||||||
|
border:1px solid #CED3D8;
|
||||||
|
border-radius:3px;
|
||||||
|
border-top:1px solid #A0A4A9;
|
||||||
|
padding:10px;
|
||||||
|
padding-left:40px;
|
||||||
|
margin-bottom:19px;
|
||||||
|
background:url(../images/password-input.png) repeat-x top;}
|
||||||
|
.login-input-pass-active{
|
||||||
|
border:none;
|
||||||
|
font:19px Arial, Helvetica, sans-serif;
|
||||||
|
color:#999;
|
||||||
|
width:250px;
|
||||||
|
border:1px solid #CED3D8;
|
||||||
|
border-radius:3px;
|
||||||
|
border-top:1px solid #A0A4A9;
|
||||||
|
padding:10px;
|
||||||
|
padding-left:40px;
|
||||||
|
margin-bottom:19px;
|
||||||
|
background:url(../images/password-input.png) repeat-x top;}
|
||||||
|
#username{
|
||||||
|
border:none;
|
||||||
|
font:19px Arial, Helvetica, sans-serif;
|
||||||
|
color:#ccc;
|
||||||
|
width:250px;
|
||||||
|
border:1px solid #CED3D8;
|
||||||
|
border-radius:3px;
|
||||||
|
border-top:1px solid #A0A4A9;
|
||||||
|
padding:10px;
|
||||||
|
padding-left:40px;
|
||||||
|
margin-bottom:19px;
|
||||||
|
background:url(../images/username-input.png) repeat-x top;}
|
||||||
|
.login-input-user-active{
|
||||||
|
border:none;
|
||||||
|
font:19px Arial, Helvetica, sans-serif;
|
||||||
|
color:#999;
|
||||||
|
width:250px;
|
||||||
|
border:1px solid #CED3D8;
|
||||||
|
border-radius:3px;
|
||||||
|
border-top:1px solid #A0A4A9;
|
||||||
|
padding:10px;
|
||||||
|
padding-left:40px;
|
||||||
|
margin-bottom:19px;
|
||||||
|
background:url(../images/username-input.png) repeat-x top;}
|
||||||
|
|
||||||
|
.loginform .log-lab{
|
||||||
|
color:#A4AAB2;
|
||||||
|
font-size:14px;
|
||||||
|
font-weight:bold;
|
||||||
|
display:block;
|
||||||
|
padding-bottom:11px;}
|
||||||
|
.button{
|
||||||
|
width:300px;
|
||||||
|
height:49px;
|
||||||
|
font:bold 16px Arial, Helvetica, sans-serif;
|
||||||
|
color:#fff;
|
||||||
|
background:url(../images/login-button.png) no-repeat 0px 0px;
|
||||||
|
border:none;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
.button:hover{
|
||||||
|
background:url(../images/login-button.png) no-repeat 0px -50px;}
|
||||||
|
.button:active{
|
||||||
|
background:url(../images/login-button.png) no-repeat 0px -100px;}
|
||||||
|
.form_wrapper a.forgot {
|
||||||
|
color: #FFA800;
|
||||||
|
float: right;
|
||||||
|
font-style: italic;
|
||||||
|
line-height: 24px;
|
||||||
|
text-shadow: 1px 1px 1px #FFFFFF;
|
||||||
|
font-size:14px;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
label.error {
|
||||||
|
display:inline; color:#B70000; font-size:11px; font-family:"Comic Sans MS", cursive;
|
||||||
|
}
|
||||||
|
input.error{ border: 1px solid #F00 !important;}
|
||||||
|
select.error{ border: 1px solid #F00 !important;}
|
||||||
|
textarea.error{ border: 1px solid #F00 !important;}
|
121
admin/html/html.inc.php
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
<?php
|
||||||
|
function startHtml($title)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<title><?php echo "Deleted Tweets Monitor :: ". $title; ?></title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="<?php echo ADMIN_CSS;?>layout.css" type="text/css" media="screen" />
|
||||||
|
<link rel="stylesheet" href="<?php echo ADMIN_CSS;?>datatable_jui.css" type="text/css" media="screen" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_CSS;?>jquery.ui.theme.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_CSS;?>datatable_jui.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_CSS;?>jquery.ui.core.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_CSS;?>jquery.ui.datepicker.css" />
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<link rel="stylesheet" href="<?php echo ADMIN_CSS;?>ie.css" type="text/css" media="screen" />
|
||||||
|
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
<script src="<?php echo ADMIN_JS;?>jquery-1.7.min.js" type="text/javascript"></script>
|
||||||
|
<script src="<?php echo ADMIN_JS;?>jquery.validate.js" type="text/javascript"></script>
|
||||||
|
<script src="<?php echo ADMIN_JS;?>jquery.dataTables.js" type="text/javascript"></script>
|
||||||
|
<script type="text/javascript" src="<?php echo ADMIN_JS;?>jquery.ui.datepicker.js"></script>
|
||||||
|
<script type="text/javascript" src="<?php echo ADMIN_JS;?>jquery-ui-1.8.11.custom.min.js"></script>
|
||||||
|
<script type="text/javascript" src="<?php echo ADMIN_JS;?>ddaccordion.js"> </script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
oTable = $('#myTable').dataTable({
|
||||||
|
"bJQueryUI": true,
|
||||||
|
"sPaginationType": "full_numbers"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
ddaccordion.init({
|
||||||
|
headerclass: "trigger", //Shared CSS class name of headers group
|
||||||
|
contentclass: "toggle", //Shared CSS class name of contents group
|
||||||
|
revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
|
||||||
|
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
|
||||||
|
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
|
||||||
|
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
|
||||||
|
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
|
||||||
|
animatedefault: false, //Should contents open by default be animated into view?
|
||||||
|
persiststate: true, //persist state of opened contents within browser session?
|
||||||
|
toggleclass: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
|
||||||
|
togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
|
||||||
|
animatespeed: 300, //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
|
||||||
|
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
|
||||||
|
//do nothing
|
||||||
|
},
|
||||||
|
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
function tophead($title)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
|
||||||
|
<header id="header">
|
||||||
|
<hgroup>
|
||||||
|
<h1 class="site_title"><a href="index.php"><img src="images/logo.png" height="50"/></a></h1>
|
||||||
|
<h2 class="section_title">Deleted Tweets Monitor Dashboard</h2><div class="btn_view_site"><a href="<?php echo ADMIN_URL;?>logout.php">Logout</a></div>
|
||||||
|
</hgroup>
|
||||||
|
</header> <!-- end of header bar -->
|
||||||
|
|
||||||
|
<section id="secondary_bar">
|
||||||
|
<div class="user">
|
||||||
|
<p>Welcome Admin</p>
|
||||||
|
<!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
|
||||||
|
</div>
|
||||||
|
<div class="breadcrumbs_container">
|
||||||
|
<article class="breadcrumbs"><a href="<?php echo ADMIN_URL;?>">Home</a> <div class="breadcrumb_divider"></div> <a class="current"><?php echo $title;?></a></article>
|
||||||
|
</div>
|
||||||
|
</section><!-- end of secondary bar -->
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
function leftNav()
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<aside id="sidebar" class="column">
|
||||||
|
|
||||||
|
<h3 class="trigger" style="margin-top:20px;">Profile Management</h3>
|
||||||
|
<ul class="toggle">
|
||||||
|
<li class="icn_edit_article"><a href="<?php echo ADMIN_URL;?>change-email.php">Change Email</a></li>
|
||||||
|
<li class="icn_edit_article"><a href="<?php echo ADMIN_URL;?>change-password.php">Change Password</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3 class="trigger">Twitter Accounts Management</h3>
|
||||||
|
<ul class="toggle">
|
||||||
|
<li class="icn_new_article"><a href="<?php echo ADMIN_URL;?>add-account.php">Add Twitter Account</a></li>
|
||||||
|
<li class="icn_view"><a href="<?php echo ADMIN_URL;?>view-accounts.php">View Twitter Accounts</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3 class="trigger">Deleted Tweets Management</h3>
|
||||||
|
<ul class="toggle">
|
||||||
|
<li class="icn_view"><a href="<?php echo ADMIN_URL;?>view-tweets.php">View Deleted Tweets</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</aside>
|
||||||
|
<!-- end of sidebar -->
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
function endHtml()
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
BIN
admin/images/Thumbs.db
Normal file
BIN
admin/images/_btn_view_site.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
admin/images/_header_bg.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
admin/images/_header_shadow.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
admin/images/_login-button.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
admin/images/_login-title.png
Normal file
After Width: | Height: | Size: 623 B |
BIN
admin/images/breadcrumb_divider.png
Normal file
After Width: | Height: | Size: 210 B |
BIN
admin/images/btn_submit.png
Normal file
After Width: | Height: | Size: 217 B |
BIN
admin/images/btn_submit_2.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
admin/images/btn_view_site.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
admin/images/header-bg.png
Normal file
After Width: | Height: | Size: 910 B |
BIN
admin/images/header_bg.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
admin/images/header_shadow.png
Normal file
After Width: | Height: | Size: 194 B |
BIN
admin/images/icn_add_user.png
Normal file
After Width: | Height: | Size: 462 B |
BIN
admin/images/icn_alert_error.png
Normal file
After Width: | Height: | Size: 386 B |
BIN
admin/images/icn_alert_info.png
Normal file
After Width: | Height: | Size: 434 B |
BIN
admin/images/icn_alert_success.png
Normal file
After Width: | Height: | Size: 347 B |
BIN
admin/images/icn_alert_warning.png
Normal file
After Width: | Height: | Size: 418 B |
BIN
admin/images/icn_audio.png
Normal file
After Width: | Height: | Size: 643 B |
BIN
admin/images/icn_categories.png
Normal file
After Width: | Height: | Size: 251 B |
BIN
admin/images/icn_edit.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
admin/images/icn_edit_article.png
Normal file
After Width: | Height: | Size: 467 B |
BIN
admin/images/icn_folder.png
Normal file
After Width: | Height: | Size: 309 B |
BIN
admin/images/icn_jump_back.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
admin/images/icn_logout.png
Normal file
After Width: | Height: | Size: 443 B |
BIN
admin/images/icn_new_article.png
Normal file
After Width: | Height: | Size: 290 B |
BIN
admin/images/icn_photo.png
Normal file
After Width: | Height: | Size: 336 B |
BIN
admin/images/icn_profile.png
Normal file
After Width: | Height: | Size: 485 B |
BIN
admin/images/icn_search.png
Normal file
After Width: | Height: | Size: 429 B |
BIN
admin/images/icn_security.png
Normal file
After Width: | Height: | Size: 465 B |
BIN
admin/images/icn_settings.png
Normal file
After Width: | Height: | Size: 272 B |
BIN
admin/images/icn_tags.png
Normal file
After Width: | Height: | Size: 292 B |
BIN
admin/images/icn_trash.png
Normal file
After Width: | Height: | Size: 284 B |
BIN
admin/images/icn_user.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
admin/images/icn_video.png
Normal file
After Width: | Height: | Size: 311 B |
BIN
admin/images/icn_view_users.png
Normal file
After Width: | Height: | Size: 528 B |
BIN
admin/images/login-button.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
admin/images/login-form-body-bg.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
admin/images/login-title.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
admin/images/logo.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
admin/images/module_footer_bg.png
Normal file
After Width: | Height: | Size: 233 B |
BIN
admin/images/password-input.png
Normal file
After Width: | Height: | Size: 562 B |
BIN
admin/images/post_message.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
admin/images/secondary_bar.png
Normal file
After Width: | Height: | Size: 263 B |
BIN
admin/images/secondary_bar_shadow.png
Normal file
After Width: | Height: | Size: 498 B |
BIN
admin/images/sidebar.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
admin/images/sidebar_divider.png
Normal file
After Width: | Height: | Size: 203 B |
BIN
admin/images/sidebar_shadow.png
Normal file
After Width: | Height: | Size: 204 B |
BIN
admin/images/table_sorter_header.png
Normal file
After Width: | Height: | Size: 239 B |
BIN
admin/images/username-input.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
admin/images/view.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
874
admin/includes/OAuth.php
Normal file
|
@ -0,0 +1,874 @@
|
||||||
|
<?php
|
||||||
|
// vim: foldmethod=marker
|
||||||
|
|
||||||
|
/* Generic exception class
|
||||||
|
*/
|
||||||
|
if (!class_exists('OAuthException')) {
|
||||||
|
class OAuthException extends Exception {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OAuthConsumer {
|
||||||
|
public $key;
|
||||||
|
public $secret;
|
||||||
|
|
||||||
|
function __construct($key, $secret, $callback_url=NULL) {
|
||||||
|
$this->key = $key;
|
||||||
|
$this->secret = $secret;
|
||||||
|
$this->callback_url = $callback_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
function __toString() {
|
||||||
|
return "OAuthConsumer[key=$this->key,secret=$this->secret]";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OAuthToken {
|
||||||
|
// access tokens and request tokens
|
||||||
|
public $key;
|
||||||
|
public $secret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key = the token
|
||||||
|
* secret = the token secret
|
||||||
|
*/
|
||||||
|
function __construct($key, $secret) {
|
||||||
|
$this->key = $key;
|
||||||
|
$this->secret = $secret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* generates the basic string serialization of a token that a server
|
||||||
|
* would respond to request_token and access_token calls with
|
||||||
|
*/
|
||||||
|
function to_string() {
|
||||||
|
return "oauth_token=" .
|
||||||
|
OAuthUtil::urlencode_rfc3986($this->key) .
|
||||||
|
"&oauth_token_secret=" .
|
||||||
|
OAuthUtil::urlencode_rfc3986($this->secret);
|
||||||
|
}
|
||||||
|
|
||||||
|
function __toString() {
|
||||||
|
return $this->to_string();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A class for implementing a Signature Method
|
||||||
|
* See section 9 ("Signing Requests") in the spec
|
||||||
|
*/
|
||||||
|
abstract class OAuthSignatureMethod {
|
||||||
|
/**
|
||||||
|
* Needs to return the name of the Signature Method (ie HMAC-SHA1)
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
abstract public function get_name();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build up the signature
|
||||||
|
* NOTE: The output of this function MUST NOT be urlencoded.
|
||||||
|
* the encoding is handled in OAuthRequest when the final
|
||||||
|
* request is serialized
|
||||||
|
* @param OAuthRequest $request
|
||||||
|
* @param OAuthConsumer $consumer
|
||||||
|
* @param OAuthToken $token
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
abstract public function build_signature($request, $consumer, $token);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies that a given signature is correct
|
||||||
|
* @param OAuthRequest $request
|
||||||
|
* @param OAuthConsumer $consumer
|
||||||
|
* @param OAuthToken $token
|
||||||
|
* @param string $signature
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function check_signature($request, $consumer, $token, $signature) {
|
||||||
|
$built = $this->build_signature($request, $consumer, $token);
|
||||||
|
return $built == $signature;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
|
||||||
|
* where the Signature Base String is the text and the key is the concatenated values (each first
|
||||||
|
* encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
|
||||||
|
* character (ASCII code 38) even if empty.
|
||||||
|
* - Chapter 9.2 ("HMAC-SHA1")
|
||||||
|
*/
|
||||||
|
class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod {
|
||||||
|
function get_name() {
|
||||||
|
return "HMAC-SHA1";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function build_signature($request, $consumer, $token) {
|
||||||
|
$base_string = $request->get_signature_base_string();
|
||||||
|
$request->base_string = $base_string;
|
||||||
|
|
||||||
|
$key_parts = array(
|
||||||
|
$consumer->secret,
|
||||||
|
($token) ? $token->secret : ""
|
||||||
|
);
|
||||||
|
|
||||||
|
$key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
|
||||||
|
$key = implode('&', $key_parts);
|
||||||
|
|
||||||
|
return base64_encode(hash_hmac('sha1', $base_string, $key, true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The PLAINTEXT method does not provide any security protection and SHOULD only be used
|
||||||
|
* over a secure channel such as HTTPS. It does not use the Signature Base String.
|
||||||
|
* - Chapter 9.4 ("PLAINTEXT")
|
||||||
|
*/
|
||||||
|
class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod {
|
||||||
|
public function get_name() {
|
||||||
|
return "PLAINTEXT";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* oauth_signature is set to the concatenated encoded values of the Consumer Secret and
|
||||||
|
* Token Secret, separated by a '&' character (ASCII code 38), even if either secret is
|
||||||
|
* empty. The result MUST be encoded again.
|
||||||
|
* - Chapter 9.4.1 ("Generating Signatures")
|
||||||
|
*
|
||||||
|
* Please note that the second encoding MUST NOT happen in the SignatureMethod, as
|
||||||
|
* OAuthRequest handles this!
|
||||||
|
*/
|
||||||
|
public function build_signature($request, $consumer, $token) {
|
||||||
|
$key_parts = array(
|
||||||
|
$consumer->secret,
|
||||||
|
($token) ? $token->secret : ""
|
||||||
|
);
|
||||||
|
|
||||||
|
$key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
|
||||||
|
$key = implode('&', $key_parts);
|
||||||
|
$request->base_string = $key;
|
||||||
|
|
||||||
|
return $key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in
|
||||||
|
* [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for
|
||||||
|
* EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a
|
||||||
|
* verified way to the Service Provider, in a manner which is beyond the scope of this
|
||||||
|
* specification.
|
||||||
|
* - Chapter 9.3 ("RSA-SHA1")
|
||||||
|
*/
|
||||||
|
abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod {
|
||||||
|
public function get_name() {
|
||||||
|
return "RSA-SHA1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Up to the SP to implement this lookup of keys. Possible ideas are:
|
||||||
|
// (1) do a lookup in a table of trusted certs keyed off of consumer
|
||||||
|
// (2) fetch via http using a url provided by the requester
|
||||||
|
// (3) some sort of specific discovery code based on request
|
||||||
|
//
|
||||||
|
// Either way should return a string representation of the certificate
|
||||||
|
protected abstract function fetch_public_cert(&$request);
|
||||||
|
|
||||||
|
// Up to the SP to implement this lookup of keys. Possible ideas are:
|
||||||
|
// (1) do a lookup in a table of trusted certs keyed off of consumer
|
||||||
|
//
|
||||||
|
// Either way should return a string representation of the certificate
|
||||||
|
protected abstract function fetch_private_cert(&$request);
|
||||||
|
|
||||||
|
public function build_signature($request, $consumer, $token) {
|
||||||
|
$base_string = $request->get_signature_base_string();
|
||||||
|
$request->base_string = $base_string;
|
||||||
|
|
||||||
|
// Fetch the private key cert based on the request
|
||||||
|
$cert = $this->fetch_private_cert($request);
|
||||||
|
|
||||||
|
// Pull the private key ID from the certificate
|
||||||
|
$privatekeyid = openssl_get_privatekey($cert);
|
||||||
|
|
||||||
|
// Sign using the key
|
||||||
|
$ok = openssl_sign($base_string, $signature, $privatekeyid);
|
||||||
|
|
||||||
|
// Release the key resource
|
||||||
|
openssl_free_key($privatekeyid);
|
||||||
|
|
||||||
|
return base64_encode($signature);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function check_signature($request, $consumer, $token, $signature) {
|
||||||
|
$decoded_sig = base64_decode($signature);
|
||||||
|
|
||||||
|
$base_string = $request->get_signature_base_string();
|
||||||
|
|
||||||
|
// Fetch the public key cert based on the request
|
||||||
|
$cert = $this->fetch_public_cert($request);
|
||||||
|
|
||||||
|
// Pull the public key ID from the certificate
|
||||||
|
$publickeyid = openssl_get_publickey($cert);
|
||||||
|
|
||||||
|
// Check the computed signature against the one passed in the query
|
||||||
|
$ok = openssl_verify($base_string, $decoded_sig, $publickeyid);
|
||||||
|
|
||||||
|
// Release the key resource
|
||||||
|
openssl_free_key($publickeyid);
|
||||||
|
|
||||||
|
return $ok == 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OAuthRequest {
|
||||||
|
private $parameters;
|
||||||
|
private $http_method;
|
||||||
|
private $http_url;
|
||||||
|
// for debug purposes
|
||||||
|
public $base_string;
|
||||||
|
public static $version = '1.0';
|
||||||
|
public static $POST_INPUT = 'php://input';
|
||||||
|
|
||||||
|
function __construct($http_method, $http_url, $parameters=NULL) {
|
||||||
|
@$parameters or $parameters = array();
|
||||||
|
$parameters = array_merge( OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
|
||||||
|
$this->parameters = $parameters;
|
||||||
|
$this->http_method = $http_method;
|
||||||
|
$this->http_url = $http_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* attempt to build up a request from what was passed to the server
|
||||||
|
*/
|
||||||
|
public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
|
||||||
|
$scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
|
||||||
|
? 'http'
|
||||||
|
: 'https';
|
||||||
|
@$http_url or $http_url = $scheme .
|
||||||
|
'://' . $_SERVER['HTTP_HOST'] .
|
||||||
|
':' .
|
||||||
|
$_SERVER['SERVER_PORT'] .
|
||||||
|
$_SERVER['REQUEST_URI'];
|
||||||
|
@$http_method or $http_method = $_SERVER['REQUEST_METHOD'];
|
||||||
|
|
||||||
|
// We weren't handed any parameters, so let's find the ones relevant to
|
||||||
|
// this request.
|
||||||
|
// If you run XML-RPC or similar you should use this to provide your own
|
||||||
|
// parsed parameter-list
|
||||||
|
if (!$parameters) {
|
||||||
|
// Find request headers
|
||||||
|
$request_headers = OAuthUtil::get_headers();
|
||||||
|
|
||||||
|
// Parse the query-string to find GET parameters
|
||||||
|
$parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']);
|
||||||
|
|
||||||
|
// It's a POST request of the proper content-type, so parse POST
|
||||||
|
// parameters and add those overriding any duplicates from GET
|
||||||
|
if ($http_method == "POST"
|
||||||
|
&& @strstr($request_headers["Content-Type"],
|
||||||
|
"application/x-www-form-urlencoded")
|
||||||
|
) {
|
||||||
|
$post_data = OAuthUtil::parse_parameters(
|
||||||
|
file_get_contents(self::$POST_INPUT)
|
||||||
|
);
|
||||||
|
$parameters = array_merge($parameters, $post_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// We have a Authorization-header with OAuth data. Parse the header
|
||||||
|
// and add those overriding any duplicates from GET or POST
|
||||||
|
if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") {
|
||||||
|
$header_parameters = OAuthUtil::split_header(
|
||||||
|
$request_headers['Authorization']
|
||||||
|
);
|
||||||
|
$parameters = array_merge($parameters, $header_parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return new OAuthRequest($http_method, $http_url, $parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pretty much a helper function to set up the request
|
||||||
|
*/
|
||||||
|
public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {
|
||||||
|
@$parameters or $parameters = array();
|
||||||
|
$defaults = array("oauth_version" => OAuthRequest::$version,
|
||||||
|
"oauth_nonce" => OAuthRequest::generate_nonce(),
|
||||||
|
"oauth_timestamp" => OAuthRequest::generate_timestamp(),
|
||||||
|
"oauth_consumer_key" => $consumer->key);
|
||||||
|
if ($token)
|
||||||
|
$defaults['oauth_token'] = $token->key;
|
||||||
|
|
||||||
|
$parameters = array_merge($defaults, $parameters);
|
||||||
|
|
||||||
|
return new OAuthRequest($http_method, $http_url, $parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set_parameter($name, $value, $allow_duplicates = true) {
|
||||||
|
if ($allow_duplicates && isset($this->parameters[$name])) {
|
||||||
|
// We have already added parameter(s) with this name, so add to the list
|
||||||
|
if (is_scalar($this->parameters[$name])) {
|
||||||
|
// This is the first duplicate, so transform scalar (string)
|
||||||
|
// into an array so we can add the duplicates
|
||||||
|
$this->parameters[$name] = array($this->parameters[$name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->parameters[$name][] = $value;
|
||||||
|
} else {
|
||||||
|
$this->parameters[$name] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_parameter($name) {
|
||||||
|
return isset($this->parameters[$name]) ? $this->parameters[$name] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_parameters() {
|
||||||
|
return $this->parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function unset_parameter($name) {
|
||||||
|
unset($this->parameters[$name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The request parameters, sorted and concatenated into a normalized string.
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function get_signable_parameters() {
|
||||||
|
// Grab all parameters
|
||||||
|
$params = $this->parameters;
|
||||||
|
|
||||||
|
// Remove oauth_signature if present
|
||||||
|
// Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
|
||||||
|
if (isset($params['oauth_signature'])) {
|
||||||
|
unset($params['oauth_signature']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return OAuthUtil::build_http_query($params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the base string of this request
|
||||||
|
*
|
||||||
|
* The base string defined as the method, the url
|
||||||
|
* and the parameters (normalized), each urlencoded
|
||||||
|
* and the concated with &.
|
||||||
|
*/
|
||||||
|
public function get_signature_base_string() {
|
||||||
|
$parts = array(
|
||||||
|
$this->get_normalized_http_method(),
|
||||||
|
$this->get_normalized_http_url(),
|
||||||
|
$this->get_signable_parameters()
|
||||||
|
);
|
||||||
|
|
||||||
|
$parts = OAuthUtil::urlencode_rfc3986($parts);
|
||||||
|
|
||||||
|
return implode('&', $parts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* just uppercases the http method
|
||||||
|
*/
|
||||||
|
public function get_normalized_http_method() {
|
||||||
|
return strtoupper($this->http_method);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* parses the url and rebuilds it to be
|
||||||
|
* scheme://host/path
|
||||||
|
*/
|
||||||
|
public function get_normalized_http_url() {
|
||||||
|
$parts = parse_url($this->http_url);
|
||||||
|
|
||||||
|
$port = @$parts['port'];
|
||||||
|
$scheme = $parts['scheme'];
|
||||||
|
$host = $parts['host'];
|
||||||
|
$path = @$parts['path'];
|
||||||
|
|
||||||
|
$port or $port = ($scheme == 'https') ? '443' : '80';
|
||||||
|
|
||||||
|
if (($scheme == 'https' && $port != '443')
|
||||||
|
|| ($scheme == 'http' && $port != '80')) {
|
||||||
|
$host = "$host:$port";
|
||||||
|
}
|
||||||
|
return "$scheme://$host$path";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* builds a url usable for a GET request
|
||||||
|
*/
|
||||||
|
public function to_url() {
|
||||||
|
$post_data = $this->to_postdata();
|
||||||
|
$out = $this->get_normalized_http_url();
|
||||||
|
if ($post_data) {
|
||||||
|
$out .= '?'.$post_data;
|
||||||
|
}
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* builds the data one would send in a POST request
|
||||||
|
*/
|
||||||
|
public function to_postdata() {
|
||||||
|
return OAuthUtil::build_http_query($this->parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* builds the Authorization: header
|
||||||
|
*/
|
||||||
|
public function to_header($realm=null) {
|
||||||
|
$first = true;
|
||||||
|
if($realm) {
|
||||||
|
$out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"';
|
||||||
|
$first = false;
|
||||||
|
} else
|
||||||
|
$out = 'Authorization: OAuth';
|
||||||
|
|
||||||
|
$total = array();
|
||||||
|
foreach ($this->parameters as $k => $v) {
|
||||||
|
if (substr($k, 0, 5) != "oauth") continue;
|
||||||
|
if (is_array($v)) {
|
||||||
|
throw new OAuthException('Arrays not supported in headers');
|
||||||
|
}
|
||||||
|
$out .= ($first) ? ' ' : ',';
|
||||||
|
$out .= OAuthUtil::urlencode_rfc3986($k) .
|
||||||
|
'="' .
|
||||||
|
OAuthUtil::urlencode_rfc3986($v) .
|
||||||
|
'"';
|
||||||
|
$first = false;
|
||||||
|
}
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __toString() {
|
||||||
|
return $this->to_url();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function sign_request($signature_method, $consumer, $token) {
|
||||||
|
$this->set_parameter(
|
||||||
|
"oauth_signature_method",
|
||||||
|
$signature_method->get_name(),
|
||||||
|
false
|
||||||
|
);
|
||||||
|
$signature = $this->build_signature($signature_method, $consumer, $token);
|
||||||
|
$this->set_parameter("oauth_signature", $signature, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function build_signature($signature_method, $consumer, $token) {
|
||||||
|
$signature = $signature_method->build_signature($this, $consumer, $token);
|
||||||
|
return $signature;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* util function: current timestamp
|
||||||
|
*/
|
||||||
|
private static function generate_timestamp() {
|
||||||
|
return time();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* util function: current nonce
|
||||||
|
*/
|
||||||
|
private static function generate_nonce() {
|
||||||
|
$mt = microtime();
|
||||||
|
$rand = mt_rand();
|
||||||
|
|
||||||
|
return md5($mt . $rand); // md5s look nicer than numbers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OAuthServer {
|
||||||
|
protected $timestamp_threshold = 300; // in seconds, five minutes
|
||||||
|
protected $version = '1.0'; // hi blaine
|
||||||
|
protected $signature_methods = array();
|
||||||
|
|
||||||
|
protected $data_store;
|
||||||
|
|
||||||
|
function __construct($data_store) {
|
||||||
|
$this->data_store = $data_store;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function add_signature_method($signature_method) {
|
||||||
|
$this->signature_methods[$signature_method->get_name()] =
|
||||||
|
$signature_method;
|
||||||
|
}
|
||||||
|
|
||||||
|
// high level functions
|
||||||
|
|
||||||
|
/**
|
||||||
|
* process a request_token request
|
||||||
|
* returns the request token on success
|
||||||
|
*/
|
||||||
|
public function fetch_request_token(&$request) {
|
||||||
|
$this->get_version($request);
|
||||||
|
|
||||||
|
$consumer = $this->get_consumer($request);
|
||||||
|
|
||||||
|
// no token required for the initial token request
|
||||||
|
$token = NULL;
|
||||||
|
|
||||||
|
$this->check_signature($request, $consumer, $token);
|
||||||
|
|
||||||
|
// Rev A change
|
||||||
|
$callback = $request->get_parameter('oauth_callback');
|
||||||
|
$new_token = $this->data_store->new_request_token($consumer, $callback);
|
||||||
|
|
||||||
|
return $new_token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* process an access_token request
|
||||||
|
* returns the access token on success
|
||||||
|
*/
|
||||||
|
public function fetch_access_token(&$request) {
|
||||||
|
$this->get_version($request);
|
||||||
|
|
||||||
|
$consumer = $this->get_consumer($request);
|
||||||
|
|
||||||
|
// requires authorized request token
|
||||||
|
$token = $this->get_token($request, $consumer, "request");
|
||||||
|
|
||||||
|
$this->check_signature($request, $consumer, $token);
|
||||||
|
|
||||||
|
// Rev A change
|
||||||
|
$verifier = $request->get_parameter('oauth_verifier');
|
||||||
|
$new_token = $this->data_store->new_access_token($token, $consumer, $verifier);
|
||||||
|
|
||||||
|
return $new_token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* verify an api call, checks all the parameters
|
||||||
|
*/
|
||||||
|
public function verify_request(&$request) {
|
||||||
|
$this->get_version($request);
|
||||||
|
$consumer = $this->get_consumer($request);
|
||||||
|
$token = $this->get_token($request, $consumer, "access");
|
||||||
|
$this->check_signature($request, $consumer, $token);
|
||||||
|
return array($consumer, $token);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Internals from here
|
||||||
|
/**
|
||||||
|
* version 1
|
||||||
|
*/
|
||||||
|
private function get_version(&$request) {
|
||||||
|
$version = $request->get_parameter("oauth_version");
|
||||||
|
if (!$version) {
|
||||||
|
// Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.
|
||||||
|
// Chapter 7.0 ("Accessing Protected Ressources")
|
||||||
|
$version = '1.0';
|
||||||
|
}
|
||||||
|
if ($version !== $this->version) {
|
||||||
|
throw new OAuthException("OAuth version '$version' not supported");
|
||||||
|
}
|
||||||
|
return $version;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* figure out the signature with some defaults
|
||||||
|
*/
|
||||||
|
private function get_signature_method(&$request) {
|
||||||
|
$signature_method =
|
||||||
|
@$request->get_parameter("oauth_signature_method");
|
||||||
|
|
||||||
|
if (!$signature_method) {
|
||||||
|
// According to chapter 7 ("Accessing Protected Ressources") the signature-method
|
||||||
|
// parameter is required, and we can't just fallback to PLAINTEXT
|
||||||
|
throw new OAuthException('No signature method parameter. This parameter is required');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!in_array($signature_method,
|
||||||
|
array_keys($this->signature_methods))) {
|
||||||
|
throw new OAuthException(
|
||||||
|
"Signature method '$signature_method' not supported " .
|
||||||
|
"try one of the following: " .
|
||||||
|
implode(", ", array_keys($this->signature_methods))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $this->signature_methods[$signature_method];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* try to find the consumer for the provided request's consumer key
|
||||||
|
*/
|
||||||
|
private function get_consumer(&$request) {
|
||||||
|
$consumer_key = @$request->get_parameter("oauth_consumer_key");
|
||||||
|
if (!$consumer_key) {
|
||||||
|
throw new OAuthException("Invalid consumer key");
|
||||||
|
}
|
||||||
|
|
||||||
|
$consumer = $this->data_store->lookup_consumer($consumer_key);
|
||||||
|
if (!$consumer) {
|
||||||
|
throw new OAuthException("Invalid consumer");
|
||||||
|
}
|
||||||
|
|
||||||
|
return $consumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* try to find the token for the provided request's token key
|
||||||
|
*/
|
||||||
|
private function get_token(&$request, $consumer, $token_type="access") {
|
||||||
|
$token_field = @$request->get_parameter('oauth_token');
|
||||||
|
$token = $this->data_store->lookup_token(
|
||||||
|
$consumer, $token_type, $token_field
|
||||||
|
);
|
||||||
|
if (!$token) {
|
||||||
|
throw new OAuthException("Invalid $token_type token: $token_field");
|
||||||
|
}
|
||||||
|
return $token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* all-in-one function to check the signature on a request
|
||||||
|
* should guess the signature method appropriately
|
||||||
|
*/
|
||||||
|
private function check_signature(&$request, $consumer, $token) {
|
||||||
|
// this should probably be in a different method
|
||||||
|
$timestamp = @$request->get_parameter('oauth_timestamp');
|
||||||
|
$nonce = @$request->get_parameter('oauth_nonce');
|
||||||
|
|
||||||
|
$this->check_timestamp($timestamp);
|
||||||
|
$this->check_nonce($consumer, $token, $nonce, $timestamp);
|
||||||
|
|
||||||
|
$signature_method = $this->get_signature_method($request);
|
||||||
|
|
||||||
|
$signature = $request->get_parameter('oauth_signature');
|
||||||
|
$valid_sig = $signature_method->check_signature(
|
||||||
|
$request,
|
||||||
|
$consumer,
|
||||||
|
$token,
|
||||||
|
$signature
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!$valid_sig) {
|
||||||
|
throw new OAuthException("Invalid signature");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check that the timestamp is new enough
|
||||||
|
*/
|
||||||
|
private function check_timestamp($timestamp) {
|
||||||
|
if( ! $timestamp )
|
||||||
|
throw new OAuthException(
|
||||||
|
'Missing timestamp parameter. The parameter is required'
|
||||||
|
);
|
||||||
|
|
||||||
|
// verify that timestamp is recentish
|
||||||
|
$now = time();
|
||||||
|
if (abs($now - $timestamp) > $this->timestamp_threshold) {
|
||||||
|
throw new OAuthException(
|
||||||
|
"Expired timestamp, yours $timestamp, ours $now"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check that the nonce is not repeated
|
||||||
|
*/
|
||||||
|
private function check_nonce($consumer, $token, $nonce, $timestamp) {
|
||||||
|
if( ! $nonce )
|
||||||
|
throw new OAuthException(
|
||||||
|
'Missing nonce parameter. The parameter is required'
|
||||||
|
);
|
||||||
|
|
||||||
|
// verify that the nonce is uniqueish
|
||||||
|
$found = $this->data_store->lookup_nonce(
|
||||||
|
$consumer,
|
||||||
|
$token,
|
||||||
|
$nonce,
|
||||||
|
$timestamp
|
||||||
|
);
|
||||||
|
if ($found) {
|
||||||
|
throw new OAuthException("Nonce already used: $nonce");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class OAuthDataStore {
|
||||||
|
function lookup_consumer($consumer_key) {
|
||||||
|
// implement me
|
||||||
|
}
|
||||||
|
|
||||||
|
function lookup_token($consumer, $token_type, $token) {
|
||||||
|
// implement me
|
||||||
|
}
|
||||||
|
|
||||||
|
function lookup_nonce($consumer, $token, $nonce, $timestamp) {
|
||||||
|
// implement me
|
||||||
|
}
|
||||||
|
|
||||||
|
function new_request_token($consumer, $callback = null) {
|
||||||
|
// return a new token attached to this consumer
|
||||||
|
}
|
||||||
|
|
||||||
|
function new_access_token($token, $consumer, $verifier = null) {
|
||||||
|
// return a new access token attached to this consumer
|
||||||
|
// for the user associated with this token if the request token
|
||||||
|
// is authorized
|
||||||
|
// should also invalidate the request token
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class OAuthUtil {
|
||||||
|
public static function urlencode_rfc3986($input) {
|
||||||
|
if (is_array($input)) {
|
||||||
|
return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input);
|
||||||
|
} else if (is_scalar($input)) {
|
||||||
|
return str_replace(
|
||||||
|
'+',
|
||||||
|
' ',
|
||||||
|
str_replace('%7E', '~', rawurlencode($input))
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// This decode function isn't taking into consideration the above
|
||||||
|
// modifications to the encoding process. However, this method doesn't
|
||||||
|
// seem to be used anywhere so leaving it as is.
|
||||||
|
public static function urldecode_rfc3986($string) {
|
||||||
|
return urldecode($string);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Utility function for turning the Authorization: header into
|
||||||
|
// parameters, has to do some unescaping
|
||||||
|
// Can filter out any non-oauth parameters if needed (default behaviour)
|
||||||
|
public static function split_header($header, $only_allow_oauth_parameters = true) {
|
||||||
|
$pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
|
||||||
|
$offset = 0;
|
||||||
|
$params = array();
|
||||||
|
while (preg_match($pattern, $header, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
|
||||||
|
$match = $matches[0];
|
||||||
|
$header_name = $matches[2][0];
|
||||||
|
$header_content = (isset($matches[5])) ? $matches[5][0] : $matches[4][0];
|
||||||
|
if (preg_match('/^oauth_/', $header_name) || !$only_allow_oauth_parameters) {
|
||||||
|
$params[$header_name] = OAuthUtil::urldecode_rfc3986($header_content);
|
||||||
|
}
|
||||||
|
$offset = $match[1] + strlen($match[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($params['realm'])) {
|
||||||
|
unset($params['realm']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $params;
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper to try to sort out headers for people who aren't running apache
|
||||||
|
public static function get_headers() {
|
||||||
|
if (function_exists('apache_request_headers')) {
|
||||||
|
// we need this to get the actual Authorization: header
|
||||||
|
// because apache tends to tell us it doesn't exist
|
||||||
|
$headers = apache_request_headers();
|
||||||
|
|
||||||
|
// sanitize the output of apache_request_headers because
|
||||||
|
// we always want the keys to be Cased-Like-This and arh()
|
||||||
|
// returns the headers in the same case as they are in the
|
||||||
|
// request
|
||||||
|
$out = array();
|
||||||
|
foreach( $headers AS $key => $value ) {
|
||||||
|
$key = str_replace(
|
||||||
|
" ",
|
||||||
|
"-",
|
||||||
|
ucwords(strtolower(str_replace("-", " ", $key)))
|
||||||
|
);
|
||||||
|
$out[$key] = $value;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// otherwise we don't have apache and are just going to have to hope
|
||||||
|
// that $_SERVER actually contains what we need
|
||||||
|
$out = array();
|
||||||
|
if( isset($_SERVER['CONTENT_TYPE']) )
|
||||||
|
$out['Content-Type'] = $_SERVER['CONTENT_TYPE'];
|
||||||
|
if( isset($_ENV['CONTENT_TYPE']) )
|
||||||
|
$out['Content-Type'] = $_ENV['CONTENT_TYPE'];
|
||||||
|
|
||||||
|
foreach ($_SERVER as $key => $value) {
|
||||||
|
if (substr($key, 0, 5) == "HTTP_") {
|
||||||
|
// this is chaos, basically it is just there to capitalize the first
|
||||||
|
// letter of every word that is not an initial HTTP and strip HTTP
|
||||||
|
// code from przemek
|
||||||
|
$key = str_replace(
|
||||||
|
" ",
|
||||||
|
"-",
|
||||||
|
ucwords(strtolower(str_replace("_", " ", substr($key, 5))))
|
||||||
|
);
|
||||||
|
$out[$key] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This function takes a input like a=b&a=c&d=e and returns the parsed
|
||||||
|
// parameters like this
|
||||||
|
// array('a' => array('b','c'), 'd' => 'e')
|
||||||
|
public static function parse_parameters( $input ) {
|
||||||
|
if (!isset($input) || !$input) return array();
|
||||||
|
|
||||||
|
$pairs = explode('&', $input);
|
||||||
|
|
||||||
|
$parsed_parameters = array();
|
||||||
|
foreach ($pairs as $pair) {
|
||||||
|
$split = explode('=', $pair, 2);
|
||||||
|
$parameter = OAuthUtil::urldecode_rfc3986($split[0]);
|
||||||
|
$value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : '';
|
||||||
|
|
||||||
|
if (isset($parsed_parameters[$parameter])) {
|
||||||
|
// We have already recieved parameter(s) with this name, so add to the list
|
||||||
|
// of parameters with this name
|
||||||
|
|
||||||
|
if (is_scalar($parsed_parameters[$parameter])) {
|
||||||
|
// This is the first duplicate, so transform scalar (string) into an array
|
||||||
|
// so we can add the duplicates
|
||||||
|
$parsed_parameters[$parameter] = array($parsed_parameters[$parameter]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$parsed_parameters[$parameter][] = $value;
|
||||||
|
} else {
|
||||||
|
$parsed_parameters[$parameter] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $parsed_parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function build_http_query($params) {
|
||||||
|
if (!$params) return '';
|
||||||
|
|
||||||
|
// Urlencode both keys and values
|
||||||
|
$keys = OAuthUtil::urlencode_rfc3986(array_keys($params));
|
||||||
|
$values = OAuthUtil::urlencode_rfc3986(array_values($params));
|
||||||
|
$params = array_combine($keys, $values);
|
||||||
|
|
||||||
|
// Parameters are sorted by name, using lexicographical byte value ordering.
|
||||||
|
// Ref: Spec: 9.1.1 (1)
|
||||||
|
uksort($params, 'strcmp');
|
||||||
|
|
||||||
|
$pairs = array();
|
||||||
|
foreach ($params as $parameter => $value) {
|
||||||
|
if (is_array($value)) {
|
||||||
|
// If two or more parameters share the same name, they are sorted by their value
|
||||||
|
// Ref: Spec: 9.1.1 (1)
|
||||||
|
natsort($value);
|
||||||
|
foreach ($value as $duplicate_value) {
|
||||||
|
$pairs[] = $parameter . '=' . $duplicate_value;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$pairs[] = $parameter . '=' . $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
|
||||||
|
// Each name-value pair is separated by an '&' character (ASCII code 38)
|
||||||
|
return implode('&', $pairs);
|
||||||
|
}
|
||||||
|
}
|
263
admin/includes/TwitterAPIExchange.php
Normal file
|
@ -0,0 +1,263 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Twitter-API-PHP : Simple PHP wrapper for the v1.1 API
|
||||||
|
*
|
||||||
|
* PHP version 5.3.10
|
||||||
|
*
|
||||||
|
* @category Awesomeness
|
||||||
|
* @package Twitter-API-PHP
|
||||||
|
* @author James Mallison <me@j7mbo.co.uk>
|
||||||
|
* @license MIT License
|
||||||
|
* @link http://github.com/j7mbo/twitter-api-php
|
||||||
|
*/
|
||||||
|
class TwitterAPIExchange
|
||||||
|
{
|
||||||
|
private $oauth_access_token;
|
||||||
|
private $oauth_access_token_secret;
|
||||||
|
private $consumer_key;
|
||||||
|
private $consumer_secret;
|
||||||
|
private $postfields;
|
||||||
|
private $getfield;
|
||||||
|
protected $oauth;
|
||||||
|
public $url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the API access object. Requires an array of settings::
|
||||||
|
* oauth access token, oauth access token secret, consumer key, consumer secret
|
||||||
|
* These are all available by creating your own application on dev.twitter.com
|
||||||
|
* Requires the cURL library
|
||||||
|
*
|
||||||
|
* @param array $settings
|
||||||
|
*/
|
||||||
|
public function __construct(array $settings)
|
||||||
|
{
|
||||||
|
if (!in_array('curl', get_loaded_extensions()))
|
||||||
|
{
|
||||||
|
throw new Exception('You need to install cURL, see: http://curl.haxx.se/docs/install.html');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($settings['oauth_access_token'])
|
||||||
|
|| !isset($settings['oauth_access_token_secret'])
|
||||||
|
|| !isset($settings['consumer_key'])
|
||||||
|
|| !isset($settings['consumer_secret']))
|
||||||
|
{
|
||||||
|
throw new Exception('Make sure you are passing in the correct parameters');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->oauth_access_token = $settings['oauth_access_token'];
|
||||||
|
$this->oauth_access_token_secret = $settings['oauth_access_token_secret'];
|
||||||
|
$this->consumer_key = $settings['consumer_key'];
|
||||||
|
$this->consumer_secret = $settings['consumer_secret'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set postfields array, example: array('screen_name' => 'J7mbo')
|
||||||
|
*
|
||||||
|
* @param array $array Array of parameters to send to API
|
||||||
|
*
|
||||||
|
* @return TwitterAPIExchange Instance of self for method chaining
|
||||||
|
*/
|
||||||
|
public function setPostfields(array $array)
|
||||||
|
{
|
||||||
|
if (!is_null($this->getGetfield()))
|
||||||
|
{
|
||||||
|
throw new Exception('You can only choose get OR post fields.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($array['status']) && substr($array['status'], 0, 1) === '@')
|
||||||
|
{
|
||||||
|
$array['status'] = sprintf("\0%s", $array['status']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->postfields = $array;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set getfield string, example: '?screen_name=J7mbo'
|
||||||
|
*
|
||||||
|
* @param string $string Get key and value pairs as string
|
||||||
|
*
|
||||||
|
* @return \TwitterAPIExchange Instance of self for method chaining
|
||||||
|
*/
|
||||||
|
public function setGetfield($string)
|
||||||
|
{
|
||||||
|
if (!is_null($this->getPostfields()))
|
||||||
|
{
|
||||||
|
throw new Exception('You can only choose get OR post fields.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$search = array('#', ',', '+', ':');
|
||||||
|
$replace = array('%23', '%2C', '%2B', '%3A');
|
||||||
|
$string = str_replace($search, $replace, $string);
|
||||||
|
|
||||||
|
$this->getfield = $string;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get getfield string (simple getter)
|
||||||
|
*
|
||||||
|
* @return string $this->getfields
|
||||||
|
*/
|
||||||
|
public function getGetfield()
|
||||||
|
{
|
||||||
|
return $this->getfield;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get postfields array (simple getter)
|
||||||
|
*
|
||||||
|
* @return array $this->postfields
|
||||||
|
*/
|
||||||
|
public function getPostfields()
|
||||||
|
{
|
||||||
|
return $this->postfields;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the Oauth object using params set in construct and additionals
|
||||||
|
* passed to this method. For v1.1, see: https://dev.twitter.com/docs/api/1.1
|
||||||
|
*
|
||||||
|
* @param string $url The API url to use. Example: https://api.twitter.com/1.1/search/tweets.json
|
||||||
|
* @param string $requestMethod Either POST or GET
|
||||||
|
* @return \TwitterAPIExchange Instance of self for method chaining
|
||||||
|
*/
|
||||||
|
public function buildOauth($url, $requestMethod)
|
||||||
|
{
|
||||||
|
if (!in_array(strtolower($requestMethod), array('post', 'get')))
|
||||||
|
{
|
||||||
|
throw new Exception('Request method must be either POST or GET');
|
||||||
|
}
|
||||||
|
|
||||||
|
$consumer_key = $this->consumer_key;
|
||||||
|
$consumer_secret = $this->consumer_secret;
|
||||||
|
$oauth_access_token = $this->oauth_access_token;
|
||||||
|
$oauth_access_token_secret = $this->oauth_access_token_secret;
|
||||||
|
|
||||||
|
$oauth = array(
|
||||||
|
'oauth_consumer_key' => $consumer_key,
|
||||||
|
'oauth_nonce' => time(),
|
||||||
|
'oauth_signature_method' => 'HMAC-SHA1',
|
||||||
|
'oauth_token' => $oauth_access_token,
|
||||||
|
'oauth_timestamp' => time(),
|
||||||
|
'oauth_version' => '1.0'
|
||||||
|
);
|
||||||
|
|
||||||
|
$getfield = $this->getGetfield();
|
||||||
|
|
||||||
|
if (!is_null($getfield))
|
||||||
|
{
|
||||||
|
$getfields = str_replace('?', '', explode('&', $getfield));
|
||||||
|
foreach ($getfields as $g)
|
||||||
|
{
|
||||||
|
$split = explode('=', $g);
|
||||||
|
$oauth[$split[0]] = $split[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$base_info = $this->buildBaseString($url, $requestMethod, $oauth);
|
||||||
|
$composite_key = rawurlencode($consumer_secret) . '&' . rawurlencode($oauth_access_token_secret);
|
||||||
|
$oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true));
|
||||||
|
$oauth['oauth_signature'] = $oauth_signature;
|
||||||
|
|
||||||
|
$this->url = $url;
|
||||||
|
$this->oauth = $oauth;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform the actual data retrieval from the API
|
||||||
|
*
|
||||||
|
* @param boolean $return If true, returns data.
|
||||||
|
*
|
||||||
|
* @return string json If $return param is true, returns json data.
|
||||||
|
*/
|
||||||
|
public function performRequest($return = true)
|
||||||
|
{
|
||||||
|
if (!is_bool($return))
|
||||||
|
{
|
||||||
|
throw new Exception('performRequest parameter must be true or false');
|
||||||
|
}
|
||||||
|
|
||||||
|
$header = array($this->buildAuthorizationHeader($this->oauth), 'Expect:');
|
||||||
|
|
||||||
|
$getfield = $this->getGetfield();
|
||||||
|
$postfields = $this->getPostfields();
|
||||||
|
|
||||||
|
$options = array(
|
||||||
|
CURLOPT_HTTPHEADER => $header,
|
||||||
|
CURLOPT_HEADER => false,
|
||||||
|
CURLOPT_URL => $this->url,
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
CURLOPT_TIMEOUT => 10,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!is_null($postfields))
|
||||||
|
{
|
||||||
|
$options[CURLOPT_POSTFIELDS] = $postfields;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($getfield !== '')
|
||||||
|
{
|
||||||
|
$options[CURLOPT_URL] .= $getfield;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$feed = curl_init();
|
||||||
|
curl_setopt_array($feed, $options);
|
||||||
|
$json = curl_exec($feed);
|
||||||
|
curl_close($feed);
|
||||||
|
|
||||||
|
if ($return) { return $json; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private method to generate the base string used by cURL
|
||||||
|
*
|
||||||
|
* @param string $baseURI
|
||||||
|
* @param string $method
|
||||||
|
* @param array $params
|
||||||
|
*
|
||||||
|
* @return string Built base string
|
||||||
|
*/
|
||||||
|
private function buildBaseString($baseURI, $method, $params)
|
||||||
|
{
|
||||||
|
$return = array();
|
||||||
|
ksort($params);
|
||||||
|
|
||||||
|
foreach($params as $key=>$value)
|
||||||
|
{
|
||||||
|
$return[] = "$key=" . $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $method . "&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $return));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private method to generate authorization header used by cURL
|
||||||
|
*
|
||||||
|
* @param array $oauth Array of oauth data generated by buildOauth()
|
||||||
|
*
|
||||||
|
* @return string $return Header used by cURL for request
|
||||||
|
*/
|
||||||
|
private function buildAuthorizationHeader($oauth)
|
||||||
|
{
|
||||||
|
$return = 'Authorization: OAuth ';
|
||||||
|
$values = array();
|
||||||
|
|
||||||
|
foreach($oauth as $key => $value)
|
||||||
|
{
|
||||||
|
$values[] = "$key=\"" . rawurlencode($value) . "\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
$return .= implode(', ', $values);
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
3376
admin/includes/cacert.pem
Normal file
168
admin/includes/functions.php
Normal file
|
@ -0,0 +1,168 @@
|
||||||
|
<?php
|
||||||
|
/****************************************************/
|
||||||
|
// Filename: functions.php
|
||||||
|
// Author: Muhammad Mudassar Tufail
|
||||||
|
// Created Date: 2012-10-15
|
||||||
|
// Description: Different functions used in the application
|
||||||
|
/****************************************************/
|
||||||
|
//// Function to protect SQL Injection
|
||||||
|
function clean($str)
|
||||||
|
{
|
||||||
|
$str = @trim($str);
|
||||||
|
if(get_magic_quotes_gpc()) {
|
||||||
|
$str = addslashes($str);
|
||||||
|
}
|
||||||
|
return mysql_real_escape_string($str);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to check the login status For the ADMIN
|
||||||
|
function checkLoginAdmin()
|
||||||
|
{
|
||||||
|
if (!isset($_SESSION['user_login_id']) || empty($_SESSION['user_login_id']) ){
|
||||||
|
$url = ADMIN_URL."login.php";
|
||||||
|
header("Location: $url");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Function that will capitalized 1st Chanrater of each word.
|
||||||
|
function capitalize($str)
|
||||||
|
{
|
||||||
|
$lowercaseTitle = strtolower($str);
|
||||||
|
$ucTitleString = ucwords($lowercaseTitle);
|
||||||
|
return $ucTitleString;
|
||||||
|
}
|
||||||
|
// Function that will delete the file physically from the directory.
|
||||||
|
function deleteFile($dir, $fileName)
|
||||||
|
{
|
||||||
|
$handle=opendir($dir);
|
||||||
|
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
if ($file == $fileName)
|
||||||
|
{
|
||||||
|
@unlink($dir.'/'.$file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Generate thumbnail of Image file
|
||||||
|
function generate_image_thumbnail($source_image_path, $thumbnail_image_path,$width,$height)
|
||||||
|
{
|
||||||
|
list( $source_image_width, $source_image_height, $source_image_type ) = getimagesize( $source_image_path );
|
||||||
|
switch ( $source_image_type )
|
||||||
|
{
|
||||||
|
case IMAGETYPE_GIF:
|
||||||
|
$source_gd_image = imagecreatefromgif( $source_image_path );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case IMAGETYPE_JPEG:
|
||||||
|
$source_gd_image = imagecreatefromjpeg( $source_image_path );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case IMAGETYPE_PNG:
|
||||||
|
$source_gd_image = imagecreatefrompng( $source_image_path );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $source_gd_image === false ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$thumbnail_image_width = $width;
|
||||||
|
$thumbnail_image_height = $height;
|
||||||
|
|
||||||
|
$source_aspect_ratio = $source_image_width / $source_image_height;
|
||||||
|
$thumbnail_aspect_ratio = $thumbnail_image_width / $thumbnail_image_height;
|
||||||
|
|
||||||
|
if ( $source_image_width <= $thumbnail_image_width && $source_image_height <= $thumbnail_image_height )
|
||||||
|
{
|
||||||
|
$thumbnail_image_width = $source_image_width;
|
||||||
|
$thumbnail_image_height = $source_image_height;
|
||||||
|
}
|
||||||
|
elseif ( $thumbnail_aspect_ratio > $source_aspect_ratio )
|
||||||
|
{
|
||||||
|
$thumbnail_image_width = ( int ) ( $thumbnail_image_height * $source_aspect_ratio );
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
$thumbnail_image_height = ( int ) ( $thumbnail_image_width / $source_aspect_ratio );
|
||||||
|
}
|
||||||
|
|
||||||
|
$thumbnail_gd_image = imagecreatetruecolor( $thumbnail_image_width, $thumbnail_image_height );
|
||||||
|
/*var_export(imagecopyresampled( $thumbnail_gd_image, $source_gd_image, 0, 0, 0, 0, $thumbnail_image_width, $thumbnail_image_height, $source_image_width, $source_image_height ) ); exit();*/
|
||||||
|
imagecopyresampled( $thumbnail_gd_image, $source_gd_image, 0, 0, 0, 0, $thumbnail_image_width, $thumbnail_image_height, $source_image_width, $source_image_height );
|
||||||
|
|
||||||
|
//var_export( imagejpeg( $thumbnail_gd_image, $thumbnail_image_path, 90 )); exit();
|
||||||
|
imagejpeg( $thumbnail_gd_image, $thumbnail_image_path, 90 );
|
||||||
|
|
||||||
|
imagedestroy( $source_gd_image );
|
||||||
|
|
||||||
|
imagedestroy( $thumbnail_gd_image );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Functions to display error messages
|
||||||
|
function successMsg($e)
|
||||||
|
{
|
||||||
|
if($e == 1){
|
||||||
|
$msg = "Password has been sent to your email.";
|
||||||
|
}if($e == 2){
|
||||||
|
$msg = "Password has been updated.";
|
||||||
|
}if($e == 3){
|
||||||
|
$msg = "Email has been updated.";
|
||||||
|
}if($e == 4){
|
||||||
|
$msg = "Record has been added.";
|
||||||
|
}if($e == 5){
|
||||||
|
$msg = "Record has been updated.";
|
||||||
|
}if($e == 6){
|
||||||
|
$msg = "Record has been deleted.";
|
||||||
|
}
|
||||||
|
//echo "<div style='color:#060;font-family:\"Comic Sans MS\",cursive;font-size:15px;'>$msg</div>";
|
||||||
|
|
||||||
|
?>
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo NOTIFICATIONS;?>css/jquery_notification.css" />
|
||||||
|
<script type="text/javascript" src="<?php echo NOTIFICATIONS;?>js/jquery_notification_v.1.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
showNotification({
|
||||||
|
message: "<?php echo $msg; ?>",
|
||||||
|
type: "success",
|
||||||
|
autoClose: true,
|
||||||
|
duration: 5
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
function errorMsg($error)
|
||||||
|
{
|
||||||
|
if($error == 1){
|
||||||
|
$errMsg = "Invalid email/password. Please try again";
|
||||||
|
}
|
||||||
|
else if($error==2)
|
||||||
|
{
|
||||||
|
$errMsg="Error: Twitter API rate limit reached";
|
||||||
|
}
|
||||||
|
else if($error==3)
|
||||||
|
{
|
||||||
|
$errMsg="Error: Twitter was not able to process that request";
|
||||||
|
}
|
||||||
|
else if($error==4)
|
||||||
|
{
|
||||||
|
$errMsg="This Account is already been added please add different account";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo NOTIFICATIONS;?>css/jquery_notification.css" />
|
||||||
|
<script type="text/javascript" src="<?php echo NOTIFICATIONS;?>js/jquery_notification_v.1.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
showNotification({
|
||||||
|
message: "<?php echo $errMsg; ?>",
|
||||||
|
type: "error",
|
||||||
|
autoClose: true,
|
||||||
|
duration: 5
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
678
admin/includes/tmhOAuth.php
Normal file
|
@ -0,0 +1,678 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* tmhOAuth
|
||||||
|
*
|
||||||
|
* An OAuth 1.0A library written in PHP.
|
||||||
|
* The library supports file uploading using multipart/form as well as general
|
||||||
|
* REST requests. OAuth authentication is sent using the an Authorization Header.
|
||||||
|
*
|
||||||
|
* @author themattharris
|
||||||
|
* @version 0.7.2
|
||||||
|
*
|
||||||
|
* 01 November 2012
|
||||||
|
*/
|
||||||
|
class tmhOAuth {
|
||||||
|
const VERSION = '0.7.2';
|
||||||
|
|
||||||
|
var $response = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new tmhOAuth object
|
||||||
|
*
|
||||||
|
* @param string $config, the configuration to use for this request
|
||||||
|
*/
|
||||||
|
public function __construct($config=array()) {
|
||||||
|
$this->params = array();
|
||||||
|
$this->headers = array();
|
||||||
|
$this->auto_fixed_time = false;
|
||||||
|
$this->buffer = null;
|
||||||
|
|
||||||
|
// default configuration options
|
||||||
|
$this->config = array_merge(
|
||||||
|
array(
|
||||||
|
// leave 'user_agent' blank for default, otherwise set this to
|
||||||
|
// something that clearly identifies your app
|
||||||
|
'user_agent' => '',
|
||||||
|
// default timezone for requests
|
||||||
|
'timezone' => 'UTC',
|
||||||
|
|
||||||
|
'use_ssl' => true,
|
||||||
|
'host' => 'api.twitter.com',
|
||||||
|
|
||||||
|
'consumer_key' => '',
|
||||||
|
'consumer_secret' => '',
|
||||||
|
'user_token' => '',
|
||||||
|
'user_secret' => '',
|
||||||
|
'force_nonce' => false,
|
||||||
|
'nonce' => false, // used for checking signatures. leave as false for auto
|
||||||
|
'force_timestamp' => false,
|
||||||
|
'timestamp' => false, // used for checking signatures. leave as false for auto
|
||||||
|
|
||||||
|
// oauth signing variables that are not dynamic
|
||||||
|
'oauth_version' => '1.0',
|
||||||
|
'oauth_signature_method' => 'HMAC-SHA1',
|
||||||
|
|
||||||
|
// you probably don't want to change any of these curl values
|
||||||
|
'curl_connecttimeout' => 30,
|
||||||
|
'curl_timeout' => 10,
|
||||||
|
|
||||||
|
// for security this should always be set to 2.
|
||||||
|
'curl_ssl_verifyhost' => 2,
|
||||||
|
// for security this should always be set to true.
|
||||||
|
'curl_ssl_verifypeer' => true,
|
||||||
|
|
||||||
|
// you can get the latest cacert.pem from here http://curl.haxx.se/ca/cacert.pem
|
||||||
|
'curl_cainfo' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'cacert.pem',
|
||||||
|
'curl_capath' => dirname(__FILE__),
|
||||||
|
|
||||||
|
'curl_followlocation' => false, // whether to follow redirects or not
|
||||||
|
|
||||||
|
// support for proxy servers
|
||||||
|
'curl_proxy' => false, // really you don't want to use this if you are using streaming
|
||||||
|
'curl_proxyuserpwd' => false, // format username:password for proxy, if required
|
||||||
|
'curl_encoding' => '', // leave blank for all supported formats, else use gzip, deflate, identity
|
||||||
|
|
||||||
|
// streaming API
|
||||||
|
'is_streaming' => false,
|
||||||
|
'streaming_eol' => "\r\n",
|
||||||
|
'streaming_metrics_interval' => 60,
|
||||||
|
|
||||||
|
// header or querystring. You should always use header!
|
||||||
|
// this is just to help me debug other developers implementations
|
||||||
|
'as_header' => true,
|
||||||
|
'debug' => false,
|
||||||
|
),
|
||||||
|
$config
|
||||||
|
);
|
||||||
|
$this->set_user_agent();
|
||||||
|
date_default_timezone_set($this->config['timezone']);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function set_user_agent() {
|
||||||
|
if (!empty($this->config['user_agent']))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ($this->config['curl_ssl_verifyhost'] && $this->config['curl_ssl_verifypeer']) {
|
||||||
|
$ssl = '+SSL';
|
||||||
|
} else {
|
||||||
|
$ssl = '-SSL';
|
||||||
|
}
|
||||||
|
|
||||||
|
$ua = 'tmhOAuth ' . self::VERSION . $ssl . ' - //github.com/themattharris/tmhOAuth';
|
||||||
|
$this->config['user_agent'] = $ua;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a random OAuth nonce.
|
||||||
|
* If 'force_nonce' is true a nonce is not generated and the value in the configuration will be retained.
|
||||||
|
*
|
||||||
|
* @param string $length how many characters the nonce should be before MD5 hashing. default 12
|
||||||
|
* @param string $include_time whether to include time at the beginning of the nonce. default true
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function create_nonce($length=12, $include_time=true) {
|
||||||
|
if ($this->config['force_nonce'] == false) {
|
||||||
|
$sequence = array_merge(range(0,9), range('A','Z'), range('a','z'));
|
||||||
|
$length = $length > count($sequence) ? count($sequence) : $length;
|
||||||
|
shuffle($sequence);
|
||||||
|
|
||||||
|
$prefix = $include_time ? microtime() : '';
|
||||||
|
$this->config['nonce'] = md5(substr($prefix . implode('', $sequence), 0, $length));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a timestamp.
|
||||||
|
* If 'force_timestamp' is true a nonce is not generated and the value in the configuration will be retained.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function create_timestamp() {
|
||||||
|
$this->config['timestamp'] = ($this->config['force_timestamp'] == false ? time() : $this->config['timestamp']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encodes the string or array passed in a way compatible with OAuth.
|
||||||
|
* If an array is passed each array value will will be encoded.
|
||||||
|
*
|
||||||
|
* @param mixed $data the scalar or array to encode
|
||||||
|
* @return $data encoded in a way compatible with OAuth
|
||||||
|
*/
|
||||||
|
private function safe_encode($data) {
|
||||||
|
if (is_array($data)) {
|
||||||
|
return array_map(array($this, 'safe_encode'), $data);
|
||||||
|
} else if (is_scalar($data)) {
|
||||||
|
return str_ireplace(
|
||||||
|
array('+', '%7E'),
|
||||||
|
array(' ', '~'),
|
||||||
|
rawurlencode($data)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decodes the string or array from it's URL encoded form
|
||||||
|
* If an array is passed each array value will will be decoded.
|
||||||
|
*
|
||||||
|
* @param mixed $data the scalar or array to decode
|
||||||
|
* @return $data decoded from the URL encoded form
|
||||||
|
*/
|
||||||
|
private function safe_decode($data) {
|
||||||
|
if (is_array($data)) {
|
||||||
|
return array_map(array($this, 'safe_decode'), $data);
|
||||||
|
} else if (is_scalar($data)) {
|
||||||
|
return rawurldecode($data);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of the standard OAuth parameters.
|
||||||
|
*
|
||||||
|
* @return array all required OAuth parameters, safely encoded
|
||||||
|
*/
|
||||||
|
private function get_defaults() {
|
||||||
|
$defaults = array(
|
||||||
|
'oauth_version' => $this->config['oauth_version'],
|
||||||
|
'oauth_nonce' => $this->config['nonce'],
|
||||||
|
'oauth_timestamp' => $this->config['timestamp'],
|
||||||
|
'oauth_consumer_key' => $this->config['consumer_key'],
|
||||||
|
'oauth_signature_method' => $this->config['oauth_signature_method'],
|
||||||
|
);
|
||||||
|
|
||||||
|
// include the user token if it exists
|
||||||
|
if ( $this->config['user_token'] )
|
||||||
|
$defaults['oauth_token'] = $this->config['user_token'];
|
||||||
|
|
||||||
|
// safely encode
|
||||||
|
foreach ($defaults as $k => $v) {
|
||||||
|
$_defaults[$this->safe_encode($k)] = $this->safe_encode($v);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $_defaults;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts and decodes OAuth parameters from the passed string
|
||||||
|
*
|
||||||
|
* @param string $body the response body from an OAuth flow method
|
||||||
|
* @return array the response body safely decoded to an array of key => values
|
||||||
|
*/
|
||||||
|
public function extract_params($body) {
|
||||||
|
$kvs = explode('&', $body);
|
||||||
|
$decoded = array();
|
||||||
|
foreach ($kvs as $kv) {
|
||||||
|
$kv = explode('=', $kv, 2);
|
||||||
|
$kv[0] = $this->safe_decode($kv[0]);
|
||||||
|
$kv[1] = $this->safe_decode($kv[1]);
|
||||||
|
$decoded[$kv[0]] = $kv[1];
|
||||||
|
}
|
||||||
|
return $decoded;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares the HTTP method for use in the base string by converting it to
|
||||||
|
* uppercase.
|
||||||
|
*
|
||||||
|
* @param string $method an HTTP method such as GET or POST
|
||||||
|
* @return void value is stored to a class variable
|
||||||
|
* @author themattharris
|
||||||
|
*/
|
||||||
|
private function prepare_method($method) {
|
||||||
|
$this->method = strtoupper($method);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares the URL for use in the base string by ripping it apart and
|
||||||
|
* reconstructing it.
|
||||||
|
*
|
||||||
|
* Ref: 3.4.1.2
|
||||||
|
*
|
||||||
|
* @param string $url the request URL
|
||||||
|
* @return void value is stored to a class variable
|
||||||
|
* @author themattharris
|
||||||
|
*/
|
||||||
|
private function prepare_url($url) {
|
||||||
|
$parts = parse_url($url);
|
||||||
|
|
||||||
|
$port = isset($parts['port']) ? $parts['port'] : false;
|
||||||
|
$scheme = $parts['scheme'];
|
||||||
|
$host = $parts['host'];
|
||||||
|
$path = isset($parts['path']) ? $parts['path'] : false;
|
||||||
|
|
||||||
|
$port or $port = ($scheme == 'https') ? '443' : '80';
|
||||||
|
|
||||||
|
if (($scheme == 'https' && $port != '443')
|
||||||
|
|| ($scheme == 'http' && $port != '80')) {
|
||||||
|
$host = "$host:$port";
|
||||||
|
}
|
||||||
|
|
||||||
|
// the scheme and host MUST be lowercase
|
||||||
|
$this->url = strtolower("$scheme://$host");
|
||||||
|
// but not the path
|
||||||
|
$this->url .= $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares all parameters for the base string and request.
|
||||||
|
* Multipart parameters are ignored as they are not defined in the specification,
|
||||||
|
* all other types of parameter are encoded for compatibility with OAuth.
|
||||||
|
*
|
||||||
|
* @param array $params the parameters for the request
|
||||||
|
* @return void prepared values are stored in class variables
|
||||||
|
*/
|
||||||
|
private function prepare_params($params) {
|
||||||
|
// do not encode multipart parameters, leave them alone
|
||||||
|
if ($this->config['multipart']) {
|
||||||
|
$this->request_params = $params;
|
||||||
|
$params = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
// signing parameters are request parameters + OAuth default parameters
|
||||||
|
$this->signing_params = array_merge($this->get_defaults(), (array)$params);
|
||||||
|
|
||||||
|
// Remove oauth_signature if present
|
||||||
|
// Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
|
||||||
|
if (isset($this->signing_params['oauth_signature'])) {
|
||||||
|
unset($this->signing_params['oauth_signature']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parameters are sorted by name, using lexicographical byte value ordering.
|
||||||
|
// Ref: Spec: 9.1.1 (1)
|
||||||
|
uksort($this->signing_params, 'strcmp');
|
||||||
|
|
||||||
|
// encode. Also sort the signed parameters from the POST parameters
|
||||||
|
foreach ($this->signing_params as $k => $v) {
|
||||||
|
$k = $this->safe_encode($k);
|
||||||
|
$v = $this->safe_encode($v);
|
||||||
|
$_signing_params[$k] = $v;
|
||||||
|
$kv[] = "{$k}={$v}";
|
||||||
|
}
|
||||||
|
|
||||||
|
// auth params = the default oauth params which are present in our collection of signing params
|
||||||
|
$this->auth_params = array_intersect_key($this->get_defaults(), $_signing_params);
|
||||||
|
if (isset($_signing_params['oauth_callback'])) {
|
||||||
|
$this->auth_params['oauth_callback'] = $_signing_params['oauth_callback'];
|
||||||
|
unset($_signing_params['oauth_callback']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_signing_params['oauth_verifier'])) {
|
||||||
|
$this->auth_params['oauth_verifier'] = $_signing_params['oauth_verifier'];
|
||||||
|
unset($_signing_params['oauth_verifier']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// request_params is already set if we're doing multipart, if not we need to set them now
|
||||||
|
if ( ! $this->config['multipart'])
|
||||||
|
$this->request_params = array_diff_key($_signing_params, $this->get_defaults());
|
||||||
|
|
||||||
|
// create the parameter part of the base string
|
||||||
|
$this->signing_params = implode('&', $kv);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares the OAuth signing key
|
||||||
|
*
|
||||||
|
* @return void prepared signing key is stored in a class variables
|
||||||
|
*/
|
||||||
|
private function prepare_signing_key() {
|
||||||
|
$this->signing_key = $this->safe_encode($this->config['consumer_secret']) . '&' . $this->safe_encode($this->config['user_secret']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare the base string.
|
||||||
|
* Ref: Spec: 9.1.3 ("Concatenate Request Elements")
|
||||||
|
*
|
||||||
|
* @return void prepared base string is stored in a class variables
|
||||||
|
*/
|
||||||
|
private function prepare_base_string() {
|
||||||
|
$base = array(
|
||||||
|
$this->method,
|
||||||
|
$this->url,
|
||||||
|
$this->signing_params
|
||||||
|
);
|
||||||
|
$this->base_string = implode('&', $this->safe_encode($base));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares the Authorization header
|
||||||
|
*
|
||||||
|
* @return void prepared authorization header is stored in a class variables
|
||||||
|
*/
|
||||||
|
private function prepare_auth_header() {
|
||||||
|
$this->headers = array();
|
||||||
|
uksort($this->auth_params, 'strcmp');
|
||||||
|
if (!$this->config['as_header']) :
|
||||||
|
$this->request_params = array_merge($this->request_params, $this->auth_params);
|
||||||
|
return;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
foreach ($this->auth_params as $k => $v) {
|
||||||
|
$kv[] = "{$k}=\"{$v}\"";
|
||||||
|
}
|
||||||
|
$this->auth_header = 'OAuth ' . implode(', ', $kv);
|
||||||
|
$this->headers['Authorization'] = $this->auth_header;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signs the request and adds the OAuth signature. This runs all the request
|
||||||
|
* parameter preparation methods.
|
||||||
|
*
|
||||||
|
* @param string $method the HTTP method being used. e.g. POST, GET, HEAD etc
|
||||||
|
* @param string $url the request URL without query string parameters
|
||||||
|
* @param array $params the request parameters as an array of key=value pairs
|
||||||
|
* @param string $useauth whether to use authentication when making the request.
|
||||||
|
*/
|
||||||
|
private function sign($method, $url, $params, $useauth) {
|
||||||
|
$this->prepare_method($method);
|
||||||
|
$this->prepare_url($url);
|
||||||
|
$this->prepare_params($params);
|
||||||
|
|
||||||
|
// we don't sign anything is we're not using auth
|
||||||
|
if ($useauth) {
|
||||||
|
$this->prepare_base_string();
|
||||||
|
$this->prepare_signing_key();
|
||||||
|
|
||||||
|
$this->auth_params['oauth_signature'] = $this->safe_encode(
|
||||||
|
base64_encode(
|
||||||
|
hash_hmac(
|
||||||
|
'sha1', $this->base_string, $this->signing_key, true
|
||||||
|
)));
|
||||||
|
|
||||||
|
$this->prepare_auth_header();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make an HTTP request using this library. This method doesn't return anything.
|
||||||
|
* Instead the response should be inspected directly.
|
||||||
|
*
|
||||||
|
* @param string $method the HTTP method being used. e.g. POST, GET, HEAD etc
|
||||||
|
* @param string $url the request URL without query string parameters
|
||||||
|
* @param array $params the request parameters as an array of key=value pairs. Default empty array
|
||||||
|
* @param string $useauth whether to use authentication when making the request. Default true
|
||||||
|
* @param string $multipart whether this request contains multipart data. Default false
|
||||||
|
* @param array $headers any custom headers to send with the request. Default empty array
|
||||||
|
*/
|
||||||
|
public function request($method, $url, $params=array(), $useauth=true, $multipart=false, $headers=array()) {
|
||||||
|
$this->config['multipart'] = $multipart;
|
||||||
|
|
||||||
|
$this->create_nonce();
|
||||||
|
$this->create_timestamp();
|
||||||
|
|
||||||
|
$this->sign($method, $url, $params, $useauth);
|
||||||
|
|
||||||
|
if (!empty($headers))
|
||||||
|
$this->headers = array_merge((array)$this->headers, (array)$headers);
|
||||||
|
|
||||||
|
return $this->curlit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make a long poll HTTP request using this library. This method is
|
||||||
|
* different to the other request methods as it isn't supposed to disconnect
|
||||||
|
*
|
||||||
|
* Using this method expects a callback which will receive the streaming
|
||||||
|
* responses.
|
||||||
|
*
|
||||||
|
* @param string $method the HTTP method being used. e.g. POST, GET, HEAD etc
|
||||||
|
* @param string $url the request URL without query string parameters
|
||||||
|
* @param array $params the request parameters as an array of key=value pairs
|
||||||
|
* @param string $callback the callback function to stream the buffer to.
|
||||||
|
*/
|
||||||
|
public function streaming_request($method, $url, $params=array(), $callback='') {
|
||||||
|
if ( ! empty($callback) ) {
|
||||||
|
if ( ! is_callable($callback) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$this->config['streaming_callback'] = $callback;
|
||||||
|
}
|
||||||
|
$this->metrics['start'] = time();
|
||||||
|
$this->metrics['interval_start'] = $this->metrics['start'];
|
||||||
|
$this->metrics['tweets'] = 0;
|
||||||
|
$this->metrics['last_tweets'] = 0;
|
||||||
|
$this->metrics['bytes'] = 0;
|
||||||
|
$this->metrics['last_bytes'] = 0;
|
||||||
|
$this->config['is_streaming'] = true;
|
||||||
|
$this->request($method, $url, $params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the updating of the current Streaming API metrics.
|
||||||
|
*/
|
||||||
|
private function update_metrics() {
|
||||||
|
$now = time();
|
||||||
|
if (($this->metrics['interval_start'] + $this->config['streaming_metrics_interval']) > $now)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$this->metrics['tps'] = round( ($this->metrics['tweets'] - $this->metrics['last_tweets']) / $this->config['streaming_metrics_interval'], 2);
|
||||||
|
$this->metrics['bps'] = round( ($this->metrics['bytes'] - $this->metrics['last_bytes']) / $this->config['streaming_metrics_interval'], 2);
|
||||||
|
|
||||||
|
$this->metrics['last_bytes'] = $this->metrics['bytes'];
|
||||||
|
$this->metrics['last_tweets'] = $this->metrics['tweets'];
|
||||||
|
$this->metrics['interval_start'] = $now;
|
||||||
|
return $this->metrics;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility function to create the request URL in the requested format
|
||||||
|
*
|
||||||
|
* @param string $request the API method without extension
|
||||||
|
* @param string $format the format of the response. Default json. Set to an empty string to exclude the format
|
||||||
|
* @return string the concatenation of the host, API version, API method and format
|
||||||
|
*/
|
||||||
|
public function url($request, $format='json') {
|
||||||
|
$format = strlen($format) > 0 ? ".$format" : '';
|
||||||
|
$proto = $this->config['use_ssl'] ? 'https:/' : 'http:/';
|
||||||
|
|
||||||
|
// backwards compatibility with v0.1
|
||||||
|
if (isset($this->config['v']))
|
||||||
|
$this->config['host'] = $this->config['host'] . '/' . $this->config['v'];
|
||||||
|
|
||||||
|
$request = ltrim($request, '/');
|
||||||
|
|
||||||
|
$pos = strlen($request) - strlen($format);
|
||||||
|
if (substr($request, $pos) === $format)
|
||||||
|
$request = substr_replace($request, '', $pos);
|
||||||
|
|
||||||
|
return implode('/', array(
|
||||||
|
$proto,
|
||||||
|
$this->config['host'],
|
||||||
|
$request . $format
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Public access to the private safe decode/encode methods
|
||||||
|
*
|
||||||
|
* @param string $text the text to transform
|
||||||
|
* @param string $mode the transformation mode. either encode or decode
|
||||||
|
* @return the string as transformed by the given mode
|
||||||
|
*/
|
||||||
|
public function transformText($text, $mode='encode') {
|
||||||
|
return $this->{"safe_$mode"}($text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility function to parse the returned curl headers and store them in the
|
||||||
|
* class array variable.
|
||||||
|
*
|
||||||
|
* @param object $ch curl handle
|
||||||
|
* @param string $header the response headers
|
||||||
|
* @return the string length of the header
|
||||||
|
*/
|
||||||
|
private function curlHeader($ch, $header) {
|
||||||
|
$this->response['raw'] .= $header;
|
||||||
|
|
||||||
|
list($key, $value) = array_pad(explode(':', $header, 2), 2, null);
|
||||||
|
$this->response['headers'][trim($key)] = trim($value);
|
||||||
|
|
||||||
|
return strlen($header);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility function to parse the returned curl buffer and store them until
|
||||||
|
* an EOL is found. The buffer for curl is an undefined size so we need
|
||||||
|
* to collect the content until an EOL is found.
|
||||||
|
*
|
||||||
|
* This function calls the previously defined streaming callback method.
|
||||||
|
*
|
||||||
|
* @param object $ch curl handle
|
||||||
|
* @param string $data the current curl buffer
|
||||||
|
*/
|
||||||
|
private function curlWrite($ch, $data) {
|
||||||
|
$l = strlen($data);
|
||||||
|
if (strpos($data, $this->config['streaming_eol']) === false) {
|
||||||
|
$this->buffer .= $data;
|
||||||
|
return $l;
|
||||||
|
}
|
||||||
|
|
||||||
|
$buffered = explode($this->config['streaming_eol'], $data);
|
||||||
|
$content = $this->buffer . $buffered[0];
|
||||||
|
|
||||||
|
$this->metrics['tweets']++;
|
||||||
|
$this->metrics['bytes'] += strlen($content);
|
||||||
|
|
||||||
|
if ( ! is_callable($this->config['streaming_callback']))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
$metrics = $this->update_metrics();
|
||||||
|
$stop = call_user_func(
|
||||||
|
$this->config['streaming_callback'],
|
||||||
|
$content,
|
||||||
|
strlen($content),
|
||||||
|
$metrics
|
||||||
|
);
|
||||||
|
$this->buffer = $buffered[1];
|
||||||
|
if ($stop)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return $l;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes a curl request. Takes no parameters as all should have been prepared
|
||||||
|
* by the request method
|
||||||
|
*
|
||||||
|
* @return void response data is stored in the class variable 'response'
|
||||||
|
*/
|
||||||
|
private function curlit() {
|
||||||
|
$this->response['raw'] = '';
|
||||||
|
|
||||||
|
// method handling
|
||||||
|
switch ($this->method) {
|
||||||
|
case 'POST':
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// GET, DELETE request so convert the parameters to a querystring
|
||||||
|
if ( ! empty($this->request_params)) {
|
||||||
|
foreach ($this->request_params as $k => $v) {
|
||||||
|
// Multipart params haven't been encoded yet.
|
||||||
|
// Not sure why you would do a multipart GET but anyway, here's the support for it
|
||||||
|
if ($this->config['multipart']) {
|
||||||
|
$params[] = $this->safe_encode($k) . '=' . $this->safe_encode($v);
|
||||||
|
} else {
|
||||||
|
$params[] = $k . '=' . $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$qs = implode('&', $params);
|
||||||
|
$this->url = strlen($qs) > 0 ? $this->url . '?' . $qs : $this->url;
|
||||||
|
$this->request_params = array();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// configure curl
|
||||||
|
$c = curl_init();
|
||||||
|
curl_setopt_array($c, array(
|
||||||
|
CURLOPT_USERAGENT => $this->config['user_agent'],
|
||||||
|
CURLOPT_CONNECTTIMEOUT => $this->config['curl_connecttimeout'],
|
||||||
|
CURLOPT_TIMEOUT => $this->config['curl_timeout'],
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
CURLOPT_SSL_VERIFYPEER => $this->config['curl_ssl_verifypeer'],
|
||||||
|
CURLOPT_SSL_VERIFYHOST => $this->config['curl_ssl_verifyhost'],
|
||||||
|
|
||||||
|
CURLOPT_FOLLOWLOCATION => $this->config['curl_followlocation'],
|
||||||
|
CURLOPT_PROXY => $this->config['curl_proxy'],
|
||||||
|
CURLOPT_ENCODING => $this->config['curl_encoding'],
|
||||||
|
CURLOPT_URL => $this->url,
|
||||||
|
// process the headers
|
||||||
|
CURLOPT_HEADERFUNCTION => array($this, 'curlHeader'),
|
||||||
|
CURLOPT_HEADER => false,
|
||||||
|
CURLINFO_HEADER_OUT => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
if ($this->config['curl_cainfo'] !== false)
|
||||||
|
curl_setopt($c, CURLOPT_CAINFO, $this->config['curl_cainfo']);
|
||||||
|
|
||||||
|
if ($this->config['curl_capath'] !== false)
|
||||||
|
curl_setopt($c, CURLOPT_CAPATH, $this->config['curl_capath']);
|
||||||
|
|
||||||
|
if ($this->config['curl_proxyuserpwd'] !== false)
|
||||||
|
curl_setopt($c, CURLOPT_PROXYUSERPWD, $this->config['curl_proxyuserpwd']);
|
||||||
|
|
||||||
|
if ($this->config['is_streaming']) {
|
||||||
|
// process the body
|
||||||
|
$this->response['content-length'] = 0;
|
||||||
|
curl_setopt($c, CURLOPT_TIMEOUT, 0);
|
||||||
|
curl_setopt($c, CURLOPT_WRITEFUNCTION, array($this, 'curlWrite'));
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($this->method) {
|
||||||
|
case 'GET':
|
||||||
|
break;
|
||||||
|
case 'POST':
|
||||||
|
curl_setopt($c, CURLOPT_POST, true);
|
||||||
|
curl_setopt($c, CURLOPT_POSTFIELDS, $this->request_params);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
curl_setopt($c, CURLOPT_CUSTOMREQUEST, $this->method);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! empty($this->request_params) ) {
|
||||||
|
// if not doing multipart we need to implode the parameters
|
||||||
|
if ( ! $this->config['multipart'] ) {
|
||||||
|
foreach ($this->request_params as $k => $v) {
|
||||||
|
$ps[] = "{$k}={$v}";
|
||||||
|
}
|
||||||
|
$this->request_params = implode('&', $ps);
|
||||||
|
}
|
||||||
|
curl_setopt($c, CURLOPT_POSTFIELDS, $this->request_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! empty($this->headers)) {
|
||||||
|
foreach ($this->headers as $k => $v) {
|
||||||
|
$headers[] = trim($k . ': ' . $v);
|
||||||
|
}
|
||||||
|
curl_setopt($c, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->config['prevent_request']) && true == $this->config['prevent_request'])
|
||||||
|
return;
|
||||||
|
|
||||||
|
// do it!
|
||||||
|
$response = curl_exec($c);
|
||||||
|
$code = curl_getinfo($c, CURLINFO_HTTP_CODE);
|
||||||
|
$info = curl_getinfo($c);
|
||||||
|
$error = curl_error($c);
|
||||||
|
$errno = curl_errno($c);
|
||||||
|
curl_close($c);
|
||||||
|
|
||||||
|
// store the response
|
||||||
|
$this->response['code'] = $code;
|
||||||
|
$this->response['response'] = $response;
|
||||||
|
$this->response['info'] = $info;
|
||||||
|
$this->response['error'] = $error;
|
||||||
|
$this->response['errno'] = $errno;
|
||||||
|
|
||||||
|
if (!isset($this->response['raw'])) {
|
||||||
|
$this->response['raw'] = '';
|
||||||
|
}
|
||||||
|
$this->response['raw'] .= $response;
|
||||||
|
|
||||||
|
return $code;
|
||||||
|
}
|
||||||
|
}
|
241
admin/includes/twitteroauth.php
Normal file
|
@ -0,0 +1,241 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Abraham Williams (abraham@abrah.am) http://abrah.am
|
||||||
|
*
|
||||||
|
* The first PHP Library to support OAuth for Twitter's REST API.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Load OAuth lib. You can find it at http://oauth.net */
|
||||||
|
require_once('OAuth.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Twitter OAuth class
|
||||||
|
*/
|
||||||
|
class TwitterOAuth {
|
||||||
|
/* Contains the last HTTP status code returned. */
|
||||||
|
public $http_code;
|
||||||
|
/* Contains the last API call. */
|
||||||
|
public $url;
|
||||||
|
/* Set up the API root URL. */
|
||||||
|
public $host = "https://api.twitter.com/1.1/";
|
||||||
|
/* Set timeout default. */
|
||||||
|
public $timeout = 30;
|
||||||
|
/* Set connect timeout. */
|
||||||
|
public $connecttimeout = 30;
|
||||||
|
/* Verify SSL Cert. */
|
||||||
|
public $ssl_verifypeer = FALSE;
|
||||||
|
/* Respons format. */
|
||||||
|
public $format = 'json';
|
||||||
|
/* Decode returned json data. */
|
||||||
|
public $decode_json = TRUE;
|
||||||
|
/* Contains the last HTTP headers returned. */
|
||||||
|
public $http_info;
|
||||||
|
/* Set the useragnet. */
|
||||||
|
public $useragent = 'TwitterOAuth v0.2.0-beta2';
|
||||||
|
/* Immediately retry the API call if the response was not successful. */
|
||||||
|
//public $retry = TRUE;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set API URLS
|
||||||
|
*/
|
||||||
|
function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; }
|
||||||
|
function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; }
|
||||||
|
function authorizeURL() { return 'https://api.twitter.com/oauth/authorize'; }
|
||||||
|
function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Debug helpers
|
||||||
|
*/
|
||||||
|
function lastStatusCode() { return $this->http_status; }
|
||||||
|
function lastAPICall() { return $this->last_api_call; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* construct TwitterOAuth object
|
||||||
|
*/
|
||||||
|
function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
|
||||||
|
$this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
|
||||||
|
$this->consumer = new OAuthConsumer($consumer_key, $consumer_secret);
|
||||||
|
if (!empty($oauth_token) && !empty($oauth_token_secret)) {
|
||||||
|
$this->token = new OAuthConsumer($oauth_token, $oauth_token_secret);
|
||||||
|
} else {
|
||||||
|
$this->token = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a request_token from Twitter
|
||||||
|
*
|
||||||
|
* @returns a key/value array containing oauth_token and oauth_token_secret
|
||||||
|
*/
|
||||||
|
function getRequestToken($oauth_callback) {
|
||||||
|
$parameters = array();
|
||||||
|
$parameters['oauth_callback'] = $oauth_callback;
|
||||||
|
$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
|
||||||
|
$token = OAuthUtil::parse_parameters($request);
|
||||||
|
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
|
||||||
|
return $token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the authorize URL
|
||||||
|
*
|
||||||
|
* @returns a string
|
||||||
|
*/
|
||||||
|
function getAuthorizeURL($token, $sign_in_with_twitter = TRUE) {
|
||||||
|
if (is_array($token)) {
|
||||||
|
$token = $token['oauth_token'];
|
||||||
|
}
|
||||||
|
if (empty($sign_in_with_twitter)) {
|
||||||
|
return $this->authorizeURL() . "?oauth_token={$token}";
|
||||||
|
} else {
|
||||||
|
return $this->authenticateURL() . "?oauth_token={$token}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exchange request token and secret for an access token and
|
||||||
|
* secret, to sign API calls.
|
||||||
|
*
|
||||||
|
* @returns array("oauth_token" => "the-access-token",
|
||||||
|
* "oauth_token_secret" => "the-access-secret",
|
||||||
|
* "user_id" => "9436992",
|
||||||
|
* "screen_name" => "abraham")
|
||||||
|
*/
|
||||||
|
function getAccessToken($oauth_verifier) {
|
||||||
|
$parameters = array();
|
||||||
|
$parameters['oauth_verifier'] = $oauth_verifier;
|
||||||
|
$request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters);
|
||||||
|
$token = OAuthUtil::parse_parameters($request);
|
||||||
|
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
|
||||||
|
return $token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* One time exchange of username and password for access token and secret.
|
||||||
|
*
|
||||||
|
* @returns array("oauth_token" => "the-access-token",
|
||||||
|
* "oauth_token_secret" => "the-access-secret",
|
||||||
|
* "user_id" => "9436992",
|
||||||
|
* "screen_name" => "abraham",
|
||||||
|
* "x_auth_expires" => "0")
|
||||||
|
*/
|
||||||
|
function getXAuthToken($username, $password) {
|
||||||
|
$parameters = array();
|
||||||
|
$parameters['x_auth_username'] = $username;
|
||||||
|
$parameters['x_auth_password'] = $password;
|
||||||
|
$parameters['x_auth_mode'] = 'client_auth';
|
||||||
|
$request = $this->oAuthRequest($this->accessTokenURL(), 'POST', $parameters);
|
||||||
|
$token = OAuthUtil::parse_parameters($request);
|
||||||
|
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
|
||||||
|
return $token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET wrapper for oAuthRequest.
|
||||||
|
*/
|
||||||
|
function get($url, $parameters = array()) {
|
||||||
|
$response = $this->oAuthRequest($url, 'GET', $parameters);
|
||||||
|
if ($this->format === 'json' && $this->decode_json) {
|
||||||
|
return json_decode($response);
|
||||||
|
}
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST wrapper for oAuthRequest.
|
||||||
|
*/
|
||||||
|
function post($url, $parameters = array()) {
|
||||||
|
$response = $this->oAuthRequest($url, 'POST', $parameters);
|
||||||
|
if ($this->format === 'json' && $this->decode_json) {
|
||||||
|
return json_decode($response);
|
||||||
|
}
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DELETE wrapper for oAuthReqeust.
|
||||||
|
*/
|
||||||
|
function delete($url, $parameters = array()) {
|
||||||
|
$response = $this->oAuthRequest($url, 'DELETE', $parameters);
|
||||||
|
if ($this->format === 'json' && $this->decode_json) {
|
||||||
|
return json_decode($response);
|
||||||
|
}
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format and sign an OAuth / API request
|
||||||
|
*/
|
||||||
|
function oAuthRequest($url, $method, $parameters) {
|
||||||
|
if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) {
|
||||||
|
$url = "{$this->host}{$url}.{$this->format}";
|
||||||
|
}
|
||||||
|
$request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters);
|
||||||
|
$request->sign_request($this->sha1_method, $this->consumer, $this->token);
|
||||||
|
switch ($method) {
|
||||||
|
case 'GET':
|
||||||
|
return $this->http($request->to_url(), 'GET');
|
||||||
|
default:
|
||||||
|
return $this->http($request->get_normalized_http_url(), $method, $request->to_postdata());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make an HTTP request
|
||||||
|
*
|
||||||
|
* @return API results
|
||||||
|
*/
|
||||||
|
function http($url, $method, $postfields = NULL) {
|
||||||
|
$this->http_info = array();
|
||||||
|
$ci = curl_init();
|
||||||
|
/* Curl settings */
|
||||||
|
curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);
|
||||||
|
curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);
|
||||||
|
curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);
|
||||||
|
curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);
|
||||||
|
curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||||
|
curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
|
||||||
|
curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));
|
||||||
|
curl_setopt($ci, CURLOPT_HEADER, FALSE);
|
||||||
|
|
||||||
|
switch ($method) {
|
||||||
|
case 'POST':
|
||||||
|
curl_setopt($ci, CURLOPT_POST, TRUE);
|
||||||
|
if (!empty($postfields)) {
|
||||||
|
curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'DELETE':
|
||||||
|
curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
||||||
|
if (!empty($postfields)) {
|
||||||
|
$url = "{$url}?{$postfields}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
curl_setopt($ci, CURLOPT_URL, $url);
|
||||||
|
$response = curl_exec($ci);
|
||||||
|
$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);
|
||||||
|
$this->http_info = array_merge($this->http_info, curl_getinfo($ci));
|
||||||
|
$this->url = $url;
|
||||||
|
curl_close ($ci);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the header info to store.
|
||||||
|
*/
|
||||||
|
function getHeader($ch, $header) {
|
||||||
|
$i = strpos($header, ':');
|
||||||
|
if (!empty($i)) {
|
||||||
|
$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));
|
||||||
|
$value = trim(substr($header, $i + 2));
|
||||||
|
$this->http_header[$key] = $value;
|
||||||
|
}
|
||||||
|
return strlen($header);
|
||||||
|
}
|
||||||
|
}
|
54
admin/index.php
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
include('../config/config.php');
|
||||||
|
include('html/html.inc.php');
|
||||||
|
include('includes/functions.php');
|
||||||
|
checkLoginAdmin();
|
||||||
|
|
||||||
|
startHtml($title = "Dashboard");
|
||||||
|
tophead($title);
|
||||||
|
leftNav();
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
if ( isset($_SESSION['succesMessage']) )
|
||||||
|
{
|
||||||
|
successMsg($_SESSION['succesMessage']);
|
||||||
|
unset($_SESSION['succesMessage']);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<section id="main" class="column">
|
||||||
|
|
||||||
|
<article class="module width_quarter">
|
||||||
|
<header>
|
||||||
|
<h3>Profile Management</h3>
|
||||||
|
</header>
|
||||||
|
<ul>
|
||||||
|
<li class="icn_edit_article"><a href="<?php echo ADMIN_URL;?>change-email.php">Change Email</a></li>
|
||||||
|
<li class="icn_edit_article"><a href="<?php echo ADMIN_URL;?>change-password.php">Change Password</a></li>
|
||||||
|
</ul>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article class="module width_quarter">
|
||||||
|
<header>
|
||||||
|
<h3>Twitter Accounts Management</h3>
|
||||||
|
</header>
|
||||||
|
<ul>
|
||||||
|
<li class="icn_new_article"><a href="<?php echo ADMIN_URL;?>add-account.php">Add Twitter Account</a></li>
|
||||||
|
<li class="icn_view"><a href="<?php echo ADMIN_URL;?>view-accounts.php">View Twitter Accounts</a></li>
|
||||||
|
</ul>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article class="module width_quarter">
|
||||||
|
<header>
|
||||||
|
<h3>Deleted Tweets Management</h3>
|
||||||
|
</header>
|
||||||
|
<ul>
|
||||||
|
<li class="icn_view"><a href="<?php echo ADMIN_URL;?>view-tweets.php">View Deleted Tweets</a></li>
|
||||||
|
</ul>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<div class="spacer"></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
endHtml();
|
||||||
|
?>
|
56
admin/js/accounts.js
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("#changePassForm").validate({
|
||||||
|
rules: {
|
||||||
|
oldPassword: {
|
||||||
|
required: true,
|
||||||
|
equalTo: "#oldHidPass"
|
||||||
|
},
|
||||||
|
newPassword: {
|
||||||
|
required: true,
|
||||||
|
minlength: 6
|
||||||
|
},
|
||||||
|
confirmPassword: {
|
||||||
|
required: true,
|
||||||
|
equalTo: "#newPassword"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
oldPassword: {
|
||||||
|
required: "Enter old password.",
|
||||||
|
equalTo: "Wrong old password."
|
||||||
|
},
|
||||||
|
newPassword: {
|
||||||
|
required: "Enter new password.",
|
||||||
|
minlength: "Enter at least 6 characters."
|
||||||
|
},
|
||||||
|
confirmPassword: {
|
||||||
|
required: "Confirm new password.",
|
||||||
|
equalTo: "Enter same password as above."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Change Email form validation
|
||||||
|
$("#changeEmailForm").validate({
|
||||||
|
rules: {
|
||||||
|
username: {
|
||||||
|
required: true,
|
||||||
|
equalTo: "#usernameHidd"
|
||||||
|
},
|
||||||
|
newEmail: {
|
||||||
|
required: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
username: {
|
||||||
|
required: "Enter old email.",
|
||||||
|
equalTo: "Old email did not match in the system."
|
||||||
|
},
|
||||||
|
newEmail: {
|
||||||
|
required: "Enter new email address.",
|
||||||
|
email: "Invalid email address."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
209
admin/js/ddaccordion.js
Normal file
|
@ -0,0 +1,209 @@
|
||||||
|
//** Accordion Content script: By Dynamic Drive, at http://www.dynamicdrive.com
|
||||||
|
//** Created: Jan 7th, 08'
|
||||||
|
|
||||||
|
//Version 1.3: April 3rd, 08':
|
||||||
|
//**1) Script now no longer conflicts with other JS frameworks
|
||||||
|
//**2) Adds custom oninit() and onopenclose() event handlers that fire when Accordion Content instance has initialized, plus whenever a header is opened/closed
|
||||||
|
//**3) Adds support for expanding header(s) using the URL parameter (ie: http://mysite.com/accordion.htm?headerclass=0,1)
|
||||||
|
|
||||||
|
//April 9th, 08': Fixed "defaultexpanded" setting not working when page first loads
|
||||||
|
|
||||||
|
//Version 1.4: June 4th, 08':
|
||||||
|
//**1) Added option to activate a header "mouseover" instead of the default "click"
|
||||||
|
//**2) Bug persistence not working when used with jquery 1.2.6
|
||||||
|
|
||||||
|
//Version 1.5: June 20th, 08':
|
||||||
|
//**1) Adds new "onemustopen:true/false" parameter, which lets you set whether at least one header should be open at all times (so never all closed).
|
||||||
|
//**2) Changed cookie path to site wide for persistence feature
|
||||||
|
//**3) Fixed bug so "expandedindices" parameter in oninit(headers, expandedindices) returns empty array [] instead of [-1] when no expanded headers found
|
||||||
|
|
||||||
|
//**1) Version 1.5.1: June 27th, 08': Fixed "defaultexpanded" setting not working properly when used with jquery 1.2.6
|
||||||
|
|
||||||
|
//Version 1.6: Oct 3rd, 08':
|
||||||
|
//**1) Adds new "mouseoverdelay" param that sets delay before headers are activated when "revealtype" param is set to "mouseover"
|
||||||
|
//**2) Fixed bug with "onemustopen" param not working properly when "revealtype" is set to "click"
|
||||||
|
|
||||||
|
//Version 1.7: March 24th, 09': Adds a 3rd revealtype setting "clickgo", which causes browser to navigate to URL specified inside the header after expanding its contents.
|
||||||
|
|
||||||
|
//Version 1.7.1: May 28th, 09': Fixed issue that causes margins/paddings in accordion DIVs to be lost in IE8
|
||||||
|
|
||||||
|
|
||||||
|
var ddaccordion={
|
||||||
|
|
||||||
|
contentclassname:{}, //object to store corresponding contentclass name based on headerclass
|
||||||
|
|
||||||
|
expandone:function(headerclass, selected){ //PUBLIC function to expand a particular header
|
||||||
|
this.toggleone(headerclass, selected, "expand")
|
||||||
|
},
|
||||||
|
|
||||||
|
collapseone:function(headerclass, selected){ //PUBLIC function to collapse a particular header
|
||||||
|
this.toggleone(headerclass, selected, "collapse")
|
||||||
|
},
|
||||||
|
|
||||||
|
expandall:function(headerclass){ //PUBLIC function to expand all headers based on their shared CSS classname
|
||||||
|
var $=jQuery
|
||||||
|
var $headers=$('.'+headerclass)
|
||||||
|
$('.'+this.contentclassname[headerclass]+':hidden').each(function(){
|
||||||
|
$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
collapseall:function(headerclass){ //PUBLIC function to collapse all headers based on their shared CSS classname
|
||||||
|
var $=jQuery
|
||||||
|
var $headers=$('.'+headerclass)
|
||||||
|
$('.'+this.contentclassname[headerclass]+':visible').each(function(){
|
||||||
|
$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleone:function(headerclass, selected, optstate){ //PUBLIC function to expand/ collapse a particular header
|
||||||
|
var $=jQuery
|
||||||
|
var $targetHeader=$('.'+headerclass).eq(selected)
|
||||||
|
var $subcontent=$('.'+this.contentclassname[headerclass]).eq(selected)
|
||||||
|
if (typeof optstate=="undefined" || optstate=="expand" && $subcontent.is(":hidden") || optstate=="collapse" && $subcontent.is(":visible"))
|
||||||
|
$targetHeader.trigger("evt_accordion")
|
||||||
|
},
|
||||||
|
|
||||||
|
expandit:function($targetHeader, $targetContent, config, useractivated, directclick){
|
||||||
|
this.transformHeader($targetHeader, config, "expand")
|
||||||
|
$targetContent.slideDown(config.animatespeed, function(){
|
||||||
|
config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), useractivated)
|
||||||
|
if (config.postreveal=="gotourl" && directclick){ //if revealtype is "Go to Header URL upon click", and this is a direct click on the header
|
||||||
|
var targetLink=($targetHeader.is("a"))? $targetHeader.get(0) : $targetHeader.find('a:eq(0)').get(0)
|
||||||
|
if (targetLink) //if this header is a link
|
||||||
|
setTimeout(function(){location=targetLink.href}, 200) //ignore link target, as window.open(targetLink, targetLink.target) doesn't work in FF if popup blocker enabled
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
collapseit:function($targetHeader, $targetContent, config, isuseractivated){
|
||||||
|
this.transformHeader($targetHeader, config, "collapse")
|
||||||
|
$targetContent.slideUp(config.animatespeed, function(){config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), isuseractivated)})
|
||||||
|
},
|
||||||
|
|
||||||
|
transformHeader:function($targetHeader, config, state){
|
||||||
|
$targetHeader.addClass((state=="expand")? config.cssclass.expand : config.cssclass.collapse) //alternate btw "expand" and "collapse" CSS classes
|
||||||
|
.removeClass((state=="expand")? config.cssclass.collapse : config.cssclass.expand)
|
||||||
|
if (config.htmlsetting.location=='src'){ //Change header image (assuming header is an image)?
|
||||||
|
$targetHeader=($targetHeader.is("img"))? $targetHeader : $targetHeader.find('img').eq(0) //Set target to either header itself, or first image within header
|
||||||
|
$targetHeader.attr('src', (state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse) //change header image
|
||||||
|
}
|
||||||
|
else if (config.htmlsetting.location=="prefix") //if change "prefix" HTML, locate dynamically added ".accordprefix" span tag and change it
|
||||||
|
$targetHeader.find('.accordprefix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
|
||||||
|
else if (config.htmlsetting.location=="suffix")
|
||||||
|
$targetHeader.find('.accordsuffix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
|
||||||
|
},
|
||||||
|
|
||||||
|
urlparamselect:function(headerclass){
|
||||||
|
var result=window.location.search.match(new RegExp(headerclass+"=((\\d+)(,(\\d+))*)", "i")) //check for "?headerclass=2,3,4" in URL
|
||||||
|
if (result!=null)
|
||||||
|
result=RegExp.$1.split(',')
|
||||||
|
return result //returns null, [index], or [index1,index2,etc], where index are the desired selected header indices
|
||||||
|
},
|
||||||
|
|
||||||
|
getCookie:function(Name){
|
||||||
|
var re=new RegExp(Name+"=[^;]+", "i") //construct RE to search for target name/value pair
|
||||||
|
if (document.cookie.match(re)) //if cookie found
|
||||||
|
return document.cookie.match(re)[0].split("=")[1] //return its value
|
||||||
|
return null
|
||||||
|
},
|
||||||
|
|
||||||
|
setCookie:function(name, value){
|
||||||
|
document.cookie = name + "=" + value + "; path=/"
|
||||||
|
},
|
||||||
|
|
||||||
|
init:function(config){
|
||||||
|
document.write('<style type="text/css">\n')
|
||||||
|
document.write('.'+config.contentclass+'{display: none}\n') //generate CSS to hide contents
|
||||||
|
document.write('<\/style>')
|
||||||
|
jQuery(document).ready(function($){
|
||||||
|
ddaccordion.urlparamselect(config.headerclass)
|
||||||
|
var persistedheaders=ddaccordion.getCookie(config.headerclass)
|
||||||
|
ddaccordion.contentclassname[config.headerclass]=config.contentclass //remember contentclass name based on headerclass
|
||||||
|
config.cssclass={collapse: config.toggleclass[0], expand: config.toggleclass[1]} //store expand and contract CSS classes as object properties
|
||||||
|
config.revealtype=config.revealtype || "click"
|
||||||
|
config.revealtype=config.revealtype.replace(/mouseover/i, "mouseenter")
|
||||||
|
if (config.revealtype=="clickgo"){
|
||||||
|
config.postreveal="gotourl" //remember added action
|
||||||
|
config.revealtype="click" //overwrite revealtype to "click" keyword
|
||||||
|
}
|
||||||
|
if (typeof config.togglehtml=="undefined")
|
||||||
|
config.htmlsetting={location: "none"}
|
||||||
|
else
|
||||||
|
config.htmlsetting={location: config.togglehtml[0], collapse: config.togglehtml[1], expand: config.togglehtml[2]} //store HTML settings as object properties
|
||||||
|
config.oninit=(typeof config.oninit=="undefined")? function(){} : config.oninit //attach custom "oninit" event handler
|
||||||
|
config.onopenclose=(typeof config.onopenclose=="undefined")? function(){} : config.onopenclose //attach custom "onopenclose" event handler
|
||||||
|
var lastexpanded={} //object to hold reference to last expanded header and content (jquery objects)
|
||||||
|
var expandedindices=ddaccordion.urlparamselect(config.headerclass) || ((config.persiststate && persistedheaders!=null)? persistedheaders : config.defaultexpanded)
|
||||||
|
if (typeof expandedindices=='string') //test for string value (exception is config.defaultexpanded, which is an array)
|
||||||
|
expandedindices=expandedindices.replace(/c/ig, '').split(',') //transform string value to an array (ie: "c1,c2,c3" becomes [1,2,3]
|
||||||
|
var $subcontents=$('.'+config["contentclass"])
|
||||||
|
if (expandedindices.length==1 && expandedindices[0]=="-1") //check for expandedindices value of [-1], indicating persistence is on and no content expanded
|
||||||
|
expandedindices=[]
|
||||||
|
if (config["collapseprev"] && expandedindices.length>1) //only allow one content open?
|
||||||
|
expandedindices=[expandedindices.pop()] //return last array element as an array (for sake of jQuery.inArray())
|
||||||
|
if (config["onemustopen"] && expandedindices.length==0) //if at least one content should be open at all times and none are, open 1st header
|
||||||
|
expandedindices=[0]
|
||||||
|
$('.'+config["headerclass"]).each(function(index){ //loop through all headers
|
||||||
|
if (/(prefix)|(suffix)/i.test(config.htmlsetting.location) && $(this).html()!=""){ //add a SPAN element to header depending on user setting and if header is a container tag
|
||||||
|
$('<span class="accordprefix"></span>').prependTo(this)
|
||||||
|
$('<span class="accordsuffix"></span>').appendTo(this)
|
||||||
|
}
|
||||||
|
$(this).attr('headerindex', index+'h') //store position of this header relative to its peers
|
||||||
|
$subcontents.eq(index).attr('contentindex', index+'c') //store position of this content relative to its peers
|
||||||
|
var $subcontent=$subcontents.eq(index)
|
||||||
|
var needle=(typeof expandedindices[0]=="number")? index : index+'' //check for data type within expandedindices array- index should match that type
|
||||||
|
if (jQuery.inArray(needle, expandedindices)!=-1){ //check for headers that should be expanded automatically (convert index to string first)
|
||||||
|
if (config.animatedefault==false)
|
||||||
|
$subcontent.show()
|
||||||
|
ddaccordion.expandit($(this), $subcontent, config, false) //Last param sets 'isuseractivated' parameter
|
||||||
|
lastexpanded={$header:$(this), $content:$subcontent}
|
||||||
|
} //end check
|
||||||
|
else{
|
||||||
|
$subcontent.hide()
|
||||||
|
config.onopenclose($(this).get(0), parseInt($(this).attr('headerindex')), $subcontent.css('display'), false) //Last Boolean value sets 'isuseractivated' parameter
|
||||||
|
ddaccordion.transformHeader($(this), config, "collapse")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$('.'+config["headerclass"]).bind("evt_accordion", function(e, isdirectclick){ //assign custom event handler that expands/ contacts a header
|
||||||
|
var $subcontent=$subcontents.eq(parseInt($(this).attr('headerindex'))) //get subcontent that should be expanded/collapsed
|
||||||
|
if ($subcontent.css('display')=="none"){
|
||||||
|
ddaccordion.expandit($(this), $subcontent, config, true, isdirectclick) //2nd last param sets 'isuseractivated' parameter
|
||||||
|
if (config["collapseprev"] && lastexpanded.$header && $(this).get(0)!=lastexpanded.$header.get(0)){ //collapse previous content?
|
||||||
|
ddaccordion.collapseit(lastexpanded.$header, lastexpanded.$content, config, true) //Last Boolean value sets 'isuseractivated' parameter
|
||||||
|
}
|
||||||
|
lastexpanded={$header:$(this), $content:$subcontent}
|
||||||
|
}
|
||||||
|
else if (!config["onemustopen"] || config["onemustopen"] && lastexpanded.$header && $(this).get(0)!=lastexpanded.$header.get(0)){
|
||||||
|
ddaccordion.collapseit($(this), $subcontent, config, true) //Last Boolean value sets 'isuseractivated' parameter
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$('.'+config["headerclass"]).bind(config.revealtype, function(){
|
||||||
|
if (config.revealtype=="mouseenter"){
|
||||||
|
clearTimeout(config.revealdelay)
|
||||||
|
var headerindex=parseInt($(this).attr("headerindex"))
|
||||||
|
config.revealdelay=setTimeout(function(){ddaccordion.expandone(config["headerclass"], headerindex)}, config.mouseoverdelay || 0)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$(this).trigger("evt_accordion", [true])
|
||||||
|
return false //cancel default click behavior
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$('.'+config["headerclass"]).bind("mouseleave", function(){
|
||||||
|
clearTimeout(config.revealdelay)
|
||||||
|
})
|
||||||
|
config.oninit($('.'+config["headerclass"]).get(), expandedindices)
|
||||||
|
$(window).bind('unload', function(){ //clean up and persist on page unload
|
||||||
|
$('.'+config["headerclass"]).unbind()
|
||||||
|
var expandedindices=[]
|
||||||
|
$('.'+config["contentclass"]+":visible").each(function(index){ //get indices of expanded headers
|
||||||
|
expandedindices.push($(this).attr('contentindex'))
|
||||||
|
})
|
||||||
|
if (config.persiststate==true && $('.'+config["headerclass"]).length>0){ //persist state?
|
||||||
|
expandedindices=(expandedindices.length==0)? '-1c' : expandedindices //No contents expanded, indicate that with dummy '-1c' value?
|
||||||
|
ddaccordion.setCookie(config.headerclass, expandedindices)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
4
admin/js/jquery-1.7.min.js
vendored
Normal file
147
admin/js/jquery-ui-1.8.11.custom.min.js
vendored
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
/*!
|
||||||
|
* jQuery UI 1.8.11
|
||||||
|
*
|
||||||
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI
|
||||||
|
*/
|
||||||
|
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
|
||||||
|
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
|
||||||
|
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
|
||||||
|
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
|
||||||
|
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
|
||||||
|
d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
|
||||||
|
c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
|
||||||
|
b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
|
||||||
|
;/*!
|
||||||
|
* jQuery UI Widget 1.8.11
|
||||||
|
*
|
||||||
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Widget
|
||||||
|
*/
|
||||||
|
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
|
||||||
|
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
|
||||||
|
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
|
||||||
|
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
|
||||||
|
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
|
||||||
|
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
|
||||||
|
;/*!
|
||||||
|
* jQuery UI Mouse 1.8.11
|
||||||
|
*
|
||||||
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Mouse
|
||||||
|
*
|
||||||
|
* Depends:
|
||||||
|
* jquery.ui.widget.js
|
||||||
|
*/
|
||||||
|
(function(b){b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=
|
||||||
|
a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,e=a.which==1,f=typeof this.options.cancel=="string"?b(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
|
||||||
|
this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(d){return c._mouseMove(d)};this._mouseUpDelegate=function(d){return c._mouseUp(d)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=
|
||||||
|
true}},_mouseMove:function(a){if(b.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
|
||||||
|
if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
|
||||||
|
;/*
|
||||||
|
* jQuery UI Draggable 1.8.11
|
||||||
|
*
|
||||||
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Draggables
|
||||||
|
*
|
||||||
|
* Depends:
|
||||||
|
* jquery.ui.core.js
|
||||||
|
* jquery.ui.mouse.js
|
||||||
|
* jquery.ui.widget.js
|
||||||
|
*/
|
||||||
|
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
|
||||||
|
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
|
||||||
|
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
|
||||||
|
this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
|
||||||
|
d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
|
||||||
|
this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&
|
||||||
|
this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
|
||||||
|
a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
|
||||||
|
0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
|
||||||
|
this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
|
||||||
|
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),
|
||||||
|
height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?
|
||||||
|
document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),
|
||||||
|
10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),
|
||||||
|
10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&
|
||||||
|
d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
|
||||||
|
this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=
|
||||||
|
this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?
|
||||||
|
e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
|
||||||
|
f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,
|
||||||
|
offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.11"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g.refreshPositions();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},
|
||||||
|
b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=
|
||||||
|
d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};
|
||||||
|
a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&
|
||||||
|
this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",
|
||||||
|
{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+
|
||||||
|
"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",
|
||||||
|
a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+
|
||||||
|
c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<
|
||||||
|
c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+
|
||||||
|
c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),
|
||||||
|
f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=
|
||||||
|
c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=
|
||||||
|
c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),
|
||||||
|
{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=
|
||||||
|
parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
|
||||||
|
;/*
|
||||||
|
* jQuery UI Resizable 1.8.11
|
||||||
|
*
|
||||||
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Resizables
|
||||||
|
*
|
||||||
|
* Depends:
|
||||||
|
* jquery.ui.core.js
|
||||||
|
* jquery.ui.mouse.js
|
||||||
|
* jquery.ui.widget.js
|
||||||
|
*/
|
||||||
|
(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
|
||||||
|
_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
|
||||||
|
top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
|
||||||
|
this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
|
||||||
|
nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
|
||||||
|
String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
|
||||||
|
this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
|
||||||
|
if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),
|
||||||
|
d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=
|
||||||
|
this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:
|
||||||
|
this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",
|
||||||
|
b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;
|
||||||
|
f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");
|
||||||
|
this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=
|
||||||
|
null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=l(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=l(b.width)&&a.minWidth&&a.minWidth>b.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+
|
||||||
|
this.size.height,k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=
|
||||||
|
[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=
|
||||||
|
this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,
|
||||||
|
a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,
|
||||||
|
c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,
|
||||||
|
originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.11"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=
|
||||||
|
b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width",
|
||||||
|
"height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};
|
||||||
|
if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-
|
||||||
|
g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,
|
||||||
|
height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=
|
||||||
|
e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,
|
||||||
|
d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?
|
||||||
|
d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=
|
||||||
|
a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&
|
||||||
|
/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");
|
||||||
|
b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/
|
||||||
|
(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
|
||||||
|
;
|
12092
admin/js/jquery.dataTables.js
vendored
Normal file
20
admin/js/jquery.equalHeight.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
// make sure the $ is pointing to JQuery and not some other library
|
||||||
|
(function($){
|
||||||
|
// add a new method to JQuery
|
||||||
|
|
||||||
|
$.fn.equalHeight = function() {
|
||||||
|
// find the tallest height in the collection
|
||||||
|
// that was passed in (.column)
|
||||||
|
tallest = 0;
|
||||||
|
this.each(function(){
|
||||||
|
thisHeight = $(this).height();
|
||||||
|
if( thisHeight > tallest)
|
||||||
|
tallest = thisHeight;
|
||||||
|
});
|
||||||
|
|
||||||
|
// set each items height to use the tallest value found
|
||||||
|
this.each(function(){
|
||||||
|
$(this).height(tallest);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})(jQuery);
|
1823
admin/js/jquery.ui.datepicker.js
vendored
Normal file
1248
admin/js/jquery.validate.js
vendored
Normal file
62
admin/js/login.js
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
$(document).ready(function() {
|
||||||
|
var $form_wrapper = $('#form_wrapper'),
|
||||||
|
$currentForm = $form_wrapper.children('form.active'),
|
||||||
|
$linkform = $form_wrapper.find('.linkform');
|
||||||
|
|
||||||
|
|
||||||
|
$form_wrapper.children('form').each(function(i){
|
||||||
|
var $theForm = $(this);
|
||||||
|
if(!$theForm.hasClass('active'))
|
||||||
|
$theForm.hide();
|
||||||
|
$theForm.data({
|
||||||
|
width : $theForm.width(),
|
||||||
|
height : $theForm.height()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
setWrapperWidth();
|
||||||
|
|
||||||
|
$linkform.bind('click',function(e){
|
||||||
|
var $link = $(this);
|
||||||
|
var target = $link.attr('rel');
|
||||||
|
$currentForm.fadeOut(400,function(){
|
||||||
|
$currentForm.removeClass('active');
|
||||||
|
$currentForm= $form_wrapper.children('form.'+target);
|
||||||
|
$form_wrapper.stop()
|
||||||
|
.animate({
|
||||||
|
width : $currentForm.data('width') + 'px',
|
||||||
|
height : $currentForm.data('height') + 'px'
|
||||||
|
},500,function(){
|
||||||
|
$currentForm.addClass('active');
|
||||||
|
$currentForm.fadeIn(400);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
|
function setWrapperWidth(){
|
||||||
|
$form_wrapper.css({
|
||||||
|
width : $currentForm.data('width') + 'px',
|
||||||
|
height : $currentForm.data('height') + 'px'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Login form validation
|
||||||
|
$("#loginInForm").validate({
|
||||||
|
rules: {
|
||||||
|
username: "required",
|
||||||
|
password: "required"
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
username: "",
|
||||||
|
password: ""
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("#forgotForm").validate({
|
||||||
|
rules: {
|
||||||
|
username: "required"
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
username: ""
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
106
admin/login.php
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
<?php
|
||||||
|
include("../config/config.php");
|
||||||
|
include("includes/functions.php");
|
||||||
|
|
||||||
|
if ( isset($_POST['loginSubmit']) )
|
||||||
|
|
||||||
|
$password = clean($_POST['password']);
|
||||||
|
$email=clean($_POST['email']);
|
||||||
|
|
||||||
|
$getUserInfo = mysql_fetch_array(mysql_query("SELECT id, email,password FROM admin WHERE password = '".$password."' AND email='".$email."'"));
|
||||||
|
|
||||||
|
if(!empty($getUserInfo['id']))
|
||||||
|
{
|
||||||
|
$_SESSION['user_login_id'] = $getUserInfo['id'];
|
||||||
|
$_SESSION['password'] = $getUserInfo['password'];
|
||||||
|
$_SESSION['email'] = $getUserInfo['email'];
|
||||||
|
$reDirUrl = ADMIN_URL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$reDirUrl = ADMIN_URL.'login.php';
|
||||||
|
$_SESSION['errorMessage'] = 1;
|
||||||
|
}
|
||||||
|
header("Location: $reDirUrl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset($_POST['forgotSubmit']) )
|
||||||
|
|
||||||
|
$email = clean($_POST['email']);
|
||||||
|
$getUserInfo = mysql_fetch_array(mysql_query("SELECT password FROM admin WHERE email = '".$email."' "));
|
||||||
|
|
||||||
|
if ( !empty($getUserInfo['password']) )
|
||||||
|
{
|
||||||
|
$from = SYSTEM_EMAIL;
|
||||||
|
$to = $email;
|
||||||
|
|
||||||
|
$subject = "Deleted Tweets Monitor - Forgot Password";
|
||||||
|
$headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
|
||||||
|
$headers .= "From: ".$from;
|
||||||
|
$message = "Dear Admin, <br>
|
||||||
|
Your password is '".$getUserInfo['password']."'. Once login you can change your password. <br><br>
|
||||||
|
|
||||||
|
Regards,<br>
|
||||||
|
Deleted Tweets Monitor Team";
|
||||||
|
|
||||||
|
mail($to,$subject,$message,$headers);
|
||||||
|
|
||||||
|
$reDirUrl = ADMIN_URL.'index.php';
|
||||||
|
$_SESSION['succesMessage'] = 1;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
$reDirUrl = ADMIN_URL.'index.php?error=6';
|
||||||
|
$_SESSION['errorMessage'] = 2;
|
||||||
|
}
|
||||||
|
header("Location: $reDirUrl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>Deleted Tweets Monitor :: Admin Login</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/login.css" />
|
||||||
|
<script src="js/jquery-1.7.min.js" type="text/javascript"></script>
|
||||||
|
<script src="js/jquery.validate.js" type="text/javascript"></script>
|
||||||
|
<script src="js/login.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
if ( isset($_SESSION['errorMessage']) )
|
||||||
|
{
|
||||||
|
errorMsg($_SESSION['errorMessage']);
|
||||||
|
unset($_SESSION['errorMessage']);
|
||||||
|
}
|
||||||
|
if ( isset($_SESSION['succesMessage']) )
|
||||||
|
{
|
||||||
|
successMsg($_SESSION['succesMessage']);
|
||||||
|
unset($_SESSION['succesMessage']);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="loginform">
|
||||||
|
<div class="title"> <img src="images/logo.png" width="150" height="68" style="padding-top:2px;" /></div>
|
||||||
|
<div class="form_wrapper" id="form_wrapper">
|
||||||
|
<form id="loginInForm" name="loginInForm" method="post" action="" class="login active">
|
||||||
|
<label class="log-lab">Email</label>
|
||||||
|
<input name="email" type="email" id="username" placeholder="email" />
|
||||||
|
<label class="log-lab">Password <a href="#" rel="forgot_password" class="forgot linkform" tabindex="4">Forgot your password?</a></label>
|
||||||
|
<input name="password" type="password" id="password" placeholder="password" />
|
||||||
|
<input type="submit" name="loginSubmit" id="loginSubmit" value="Login" class="button" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form id="forgotForm" name="forgotForm" method="post" action="" class="forgot_password">
|
||||||
|
<label class="log-lab">Email</label>
|
||||||
|
<input name="username" type="email" id="username" placeholder="email" />
|
||||||
|
<input type="submit" value="Send reminder" name="forgotSubmit" id="forgotSubmit" class="button" style="display:block;" />
|
||||||
|
<a href="#" rel="login" class="forgot linkform" style="display:block;">Suddenly remebered? Log in here</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
8
admin/logout.php
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
include("../config/config.php");
|
||||||
|
|
||||||
|
session_destroy();
|
||||||
|
|
||||||
|
$url = ADMIN_URL;
|
||||||
|
header("Location:$url");
|
||||||
|
?>
|
67
admin/monitor-timeline.php
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
<?php
|
||||||
|
include('../config/config.php');
|
||||||
|
include('html/html.inc.php');
|
||||||
|
include('../includes/classes/class.Tweet.php');
|
||||||
|
include('../includes/classes/class.User.php');
|
||||||
|
include('includes/functions.php');
|
||||||
|
include('includes/tmhOAuth.php');
|
||||||
|
|
||||||
|
$objUser=new User();
|
||||||
|
$objTweet=new Tweet();
|
||||||
|
$allUsers=$objUser->getAllUserNames();
|
||||||
|
|
||||||
|
if($allUsers)
|
||||||
|
{
|
||||||
|
foreach($allUsers as $user)
|
||||||
|
{
|
||||||
|
$objTweet->user_id=$user->user_id;
|
||||||
|
$getSinceId=$objTweet->getLatestUserTweet();
|
||||||
|
$since_id=$getSinceId[0]->tweet_id;
|
||||||
|
|
||||||
|
$connection = new tmhOAuth(array( 'consumer_key' => $consumer_key, 'consumer_secret' => $consumer_secret, 'user_token' => $user_token, 'user_secret' => $user_secret ));
|
||||||
|
$http_code = $connection->request('GET',$connection->url('1.1/statuses/user_timeline'), array('screen_name' => $user->screen_name,'since_id'=>$since_id));
|
||||||
|
|
||||||
|
if ($http_code == 200)
|
||||||
|
{
|
||||||
|
$tweet_data = json_decode($connection->response['response'],true);
|
||||||
|
|
||||||
|
if(sizeof($tweet_data)>0 && $tweet_data)
|
||||||
|
{
|
||||||
|
$userArray=array();
|
||||||
|
foreach($tweet_data as $user)
|
||||||
|
{
|
||||||
|
$userArray=$user['user'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sizeof($userArray)>0)
|
||||||
|
{
|
||||||
|
$objUser->id=$userArray['id_str'];
|
||||||
|
$user_id=$userArray['id_str'];
|
||||||
|
$objUser->screen_name=$userArray['screen_name'];
|
||||||
|
$objUser->name=$userArray['name'];
|
||||||
|
$objUser->profile_image_url=$userArray['profile_image_url'];
|
||||||
|
$objUser->location=$userArray['location'];
|
||||||
|
$objUser->created_at=date('y-m-d h:m:s',strtotime($userArray['created_at']));
|
||||||
|
$objUser->friends_count=$userArray['friends_count'];
|
||||||
|
$objUser->followers_count=$userArray['followers_count'];
|
||||||
|
$objUser->statuses_count=$userArray['statuses_count'];
|
||||||
|
$objUser->updateUserAccount();
|
||||||
|
}
|
||||||
|
foreach($tweet_data as $tweet)
|
||||||
|
{
|
||||||
|
if(isset($tweet['retweeted_status']))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$objTweet->id=$tweet['id_str'];
|
||||||
|
$objTweet->tweet_text=base64_encode($tweet['text']);
|
||||||
|
$objTweet->created_at=date('y-m-d h:m:s',strtotime($tweet['created_at']));
|
||||||
|
$objTweet->user_id=$user_id;
|
||||||
|
$objTweet->saveTweet();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
79
admin/monitor-tweets.php
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
<?php
|
||||||
|
include('../config/config.php');
|
||||||
|
include('../includes/classes/class.Tweet.php');
|
||||||
|
include('includes/functions.php');
|
||||||
|
include('includes/twitteroauth.php');
|
||||||
|
|
||||||
|
$objTweet=new Tweet();
|
||||||
|
$allTweetIds=$objTweet->getAllTweetIds();
|
||||||
|
|
||||||
|
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
|
||||||
|
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
|
||||||
|
return $connection;
|
||||||
|
}
|
||||||
|
|
||||||
|
$connection = getConnectionWithAccessToken($consumer_key, $consumer_secret, $user_token, $user_secret);
|
||||||
|
|
||||||
|
$temp=array();
|
||||||
|
|
||||||
|
if($allTweetIds)
|
||||||
|
{
|
||||||
|
$index=0;
|
||||||
|
$count=0;
|
||||||
|
$tweetIdsArray=array();
|
||||||
|
|
||||||
|
foreach($allTweetIds as $id)
|
||||||
|
{
|
||||||
|
if($count<100)
|
||||||
|
{
|
||||||
|
$tweetIdsArray[$index][$count]=$id->tweet_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($count==99)
|
||||||
|
{
|
||||||
|
$index++;
|
||||||
|
$count=0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($tweetIdsArray as $idArray)
|
||||||
|
{
|
||||||
|
$ids="";
|
||||||
|
for($i=0;$i<sizeof($idArray);$i++)
|
||||||
|
{
|
||||||
|
if($i<sizeof($idArray)-1)
|
||||||
|
{
|
||||||
|
$ids.=$idArray[$i].",";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ids.=$idArray[$i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$requestUrl="https://api.twitter.com/1.1/statuses/lookup.json?id=".$ids."&trim_user=true&map=true";
|
||||||
|
$tweets=$connection->get($requestUrl);
|
||||||
|
$response=json_decode(json_encode($tweets->id),true);
|
||||||
|
|
||||||
|
for($i=0;$i<sizeof($idArray);$i++)
|
||||||
|
{
|
||||||
|
if($response[$idArray[$i]]=='' || $response[$idArray[$i]]==NULL)
|
||||||
|
{
|
||||||
|
$tweetId=$idArray[$i];
|
||||||
|
$check_tweet = $connection->get("https://api.twitter.com/1.1/statuses/show/'$tweetId'.json");
|
||||||
|
$check_response=$check_tweet->errors;
|
||||||
|
$check_code=$check_response[0]->code;
|
||||||
|
|
||||||
|
if($check_code==34)
|
||||||
|
{
|
||||||
|
$objTweet->status='Y';
|
||||||
|
$objTweet->id=$tweetId;
|
||||||
|
$objTweet->updateTweetStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
106
admin/plugins/notifications/css/jquery_notification.css
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
body{
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#info_message{
|
||||||
|
display: none;
|
||||||
|
width: 100%;
|
||||||
|
height: 51px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 50000;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.center_auto{
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 950px;
|
||||||
|
padding: 15px 25px;
|
||||||
|
}
|
||||||
|
#info_message .message_area{
|
||||||
|
float: left;
|
||||||
|
width: 98%;
|
||||||
|
}
|
||||||
|
#info_message .message_area span.link_ribbon{
|
||||||
|
color: #999999;
|
||||||
|
text-decoration: underline;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
#info_message .button_area{
|
||||||
|
float: left;
|
||||||
|
width: 11px;
|
||||||
|
height: 10px;
|
||||||
|
margin-top: 3px;
|
||||||
|
}
|
||||||
|
.error_bg{
|
||||||
|
background: url('../images/error_bg.png') 0 0 repeat-x;
|
||||||
|
}
|
||||||
|
.error_bg .message_area{
|
||||||
|
font:bold 14px arial;
|
||||||
|
color: #a20510;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
}
|
||||||
|
.error_bg .button_area{
|
||||||
|
background: url('../images/error_close.png') 0 0 no-repeat;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.error_bg .info_more_descrption{
|
||||||
|
|
||||||
|
-moz-box-shadow: 0 0 5px #b2495b;
|
||||||
|
-webkit-box-shadow: 0 0 5px #b2495b;
|
||||||
|
box-shadow: 0 0 5px #b2495b;
|
||||||
|
}
|
||||||
|
.succ_bg{
|
||||||
|
background: url('../images/succ_bg.png') 0 0 repeat-x;
|
||||||
|
}
|
||||||
|
.succ_bg .message_area{
|
||||||
|
font:bold 14px arial;
|
||||||
|
color: #2f7c00;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
}
|
||||||
|
.succ_bg .button_area{
|
||||||
|
background: url('../images/succ_close.png') 0 0 no-repeat;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.info_bg{
|
||||||
|
background: url('../images/info_bg.png') 0 0 repeat-x;
|
||||||
|
}
|
||||||
|
.info_bg .message_area{
|
||||||
|
font:bold 14px arial;
|
||||||
|
color: #0d9a95;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
}
|
||||||
|
.info_bg .button_area{
|
||||||
|
background: url('../images/info_close.png') 0 0 no-repeat;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.warn_bg{
|
||||||
|
background: url('../images/warn_bg.png') 0 0 repeat-x;
|
||||||
|
}
|
||||||
|
.warn_bg .message_area{
|
||||||
|
font:bold 14px arial;
|
||||||
|
color: #a39709;
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
}
|
||||||
|
.warn_bg .button_area{
|
||||||
|
background: url('../images/warn_close.png') 0 0 no-repeat;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.clearboth{
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
.info_more_descrption{
|
||||||
|
display: none;
|
||||||
|
width: 950px;
|
||||||
|
height: 300px;
|
||||||
|
background: #fff;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 10px;
|
||||||
|
background: #fbfbfb;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.succ_bg .info_more_descrption{
|
||||||
|
-moz-box-shadow: 0 0 5px #56a25e;
|
||||||
|
-webkit-box-shadow: 0 0 5px #56a25e;
|
||||||
|
box-shadow: 0 0 5px #56a25e;
|
||||||
|
}
|