Subversion Repositories nxc_twitter

Compare Revisions

Ignore whitespace Rev 1 → Rev 2

/extension/nxc_twitter_publish/ezinfo.php
1,18 → 1,19
<?php
/**
* @package nxcTwitterPublish
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 09 Mar 2010
**/
 
class nxc_twitter_publishInfo {
class nxc_twitter_publishInfo
{
public static function info() {
return array(
'Name' => 'NXC Twitter publish',
'Version' => '1.0',
'Author' => 'Dolgushev Serhey <a href="mailto:serhey.dolgushev@nxc.no" target="blank">&lt;serhey.dolgushev@nxc.no&gt;</a>',
'Copyright' => 'Copyright &copy; 2010 <a href="http://nxc.no" target="blank">NXC Consulting</a>'
'Author' => 'SD / NXC International SA',
'Copyright' => 'Copyright &copy; 2011 <a href="http://nxc.no" target="blank">NXC Consulting</a>'
);
}
}
?>
?>
/extension/nxc_twitter_publish/settings/workflow.ini.append.php
3,4 → 3,4
[EventSettings]
ExtensionDirectories[]=nxc_twitter_publish
AvailableEventTypes[]=event_nxctwitterpublish
*/ ?>
*/ ?>
/extension/nxc_twitter_publish/eventtypes/event/nxctwitterpublish/nxctwitterpublishtype.php
1,13 → 1,13
<?php
/**
* @package nxcTwitterPublish
* @package nxcTwitter
* @class nxcTwitterPublishType
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 29 Nov 2010
**/
 
class nxcTwitterPublishType extends eZWorkflowEventType {
 
class nxcTwitterPublishType extends eZWorkflowEventType
{
const TYPE_ID = 'nxctwitterpublish';
 
public static $eventParams = array(
39,7 → 39,10
$iniOAuthToken->variable( 'AccessToken', 'Secret' )
);
 
if( (bool) $event->attribute( self::$eventParams['publishOnlyOnCreate'] ) && $object->attribute( 'current_version' ) != 1 ) {
if(
(bool) $event->attribute( self::$eventParams['publishOnlyOnCreate'] )
&& $object->attribute( 'current_version' ) != 1
) {
return eZWorkflowType::STATUS_ACCEPTED;
}
 
101,12 → 104,12
return eZContentClass::fetchList( eZContentClass::VERSION_STATUS_DEFINED, true );
}
case 'contentclass_attribute_list': {
$classList = $this->attribute( 'contentclass_list' );
if( $this->attribute( 'current_class_id' ) !== 0 ) {
$classList = $this->attribute( 'contentclass_list' );
if( $this->attribute( 'current_class_id' ) !== 0 ) {
$classID = $this->attribute( 'current_class_id' );
} else {
$classID = isset( $classList[0] ) ? $classList[0]->attribute( 'id' ) : false;
}
} else {
$classID = isset( $classList[0] ) ? $classList[0]->attribute( 'id' ) : false;
}
 
return is_numeric( $classID ) ? eZContentClassAttribute::fetchListByClassID( $classID ) : array();
}
173,4 → 176,4
}
 
eZWorkflowEventType::registerEventType( nxcTwitterPublishType::TYPE_ID, 'nxcTwitterPublishType' );
?>
?>
/extension/nxc_twitter_publish/settings.php
1,12 → 1,12
<?php
/**
* @package nxcTwitterPublish
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 18 Jan 2010
**/
 
class nxc_twitter_publishSettings extends nxcExtensionSettings {
 
class nxc_twitter_publishSettings extends nxcExtensionSettings
{
public $defaultOrder = 15;
public $dependencies = array( 'nxc_twitter_api' );
 
14,4 → 14,4
 
public function deactivate() {}
}
?>
?>
/extension/nxc_twitter_signin/ezinfo.php
1,18 → 1,19
<?php
/**
* @package nxcTwitterSignin
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 25 Nov 2010
**/
 
class nxc_twitter_signinInfo {
class nxc_twitter_signinInfo
{
public static function info() {
return array(
'Name' => 'NXC Twitter Signin',
'Version' => '1.0',
'Author' => 'Dolgushev Serhey <a href="mailto:serhey.dolgushev@nxc.no" target="blank">&lt;serhey.dolgushev@nxc.no&gt;</a>',
'Copyright' => 'Copyright &copy; 2010 <a href="http://nxc.no" target="blank">NXC Consulting</a>'
'Author' => 'SD / NXC International SA',
'Copyright' => 'Copyright &copy; 2011 <a href="http://nxc.no" target="blank">NXC Consulting</a>'
);
}
}
?>
?>
/extension/nxc_twitter_signin/settings/module.ini.append.php
3,4 → 3,4
[ModuleSettings]
ExtensionRepositories[]=nxc_twitter_signin
ModuleList[]=nxc_twitter_signin
*/ ?>
*/ ?>
/extension/nxc_twitter_signin/settings/design.ini.append.php
5,4 → 5,4
 
[StylesheetSettings]
CSSFileList[]=nxc_twitter_signin.css
*/ ?>
*/ ?>
/extension/nxc_twitter_signin/settings/siteaccess/eng/override.ini.append.php
4,5 → 4,4
Source=user/login.tpl
MatchFile=user/login_with_tweeter.tpl
Subdir=templates
 
*/ ?>
*/ ?>
/extension/nxc_twitter_signin/settings/site.ini.append.php
3,4 → 3,4
[RoleSettings]
PolicyOmitList[]=nxc_twitter_signin/signin
PolicyOmitList[]=nxc_twitter_signin/callback
*/ ?>
*/ ?>
/extension/nxc_twitter_signin/settings.php
1,12 → 1,12
<?php
/**
* @package nxcTwitterSignin
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 25 Nov 2010
**/
 
class nxc_twitter_signinSettings extends nxcExtensionSettings {
 
class nxc_twitter_signinSettings extends nxcExtensionSettings
{
public $defaultOrder = 15;
public $dependencies = array( 'nxc_twitter_api' );
 
14,4 → 14,4
 
public function deactivate() {}
}
?>
?>
/extension/nxc_twitter_signin/modules/nxc_twitter_signin/callback.php
1,6 → 1,6
<?php
/**
* @package nxcTwitterSignin
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 26 Nov 2010
**/
94,4 → 94,4
 
return $module->redirectTo( $redirectURI );
}
?>
?>
/extension/nxc_twitter_signin/modules/nxc_twitter_signin/module.php
1,6 → 1,6
<?php
/**
* @package nxcTwitterSignin
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 25 Nov 2010
**/
26,4 → 26,4
 
$FunctionList = array();
$FunctionList['twitter_signin'] = array();
?>
?>
/extension/nxc_twitter_signin/modules/nxc_twitter_signin/signin.php
1,6 → 1,6
<?php
/**
* @package nxcTwitterSignin
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 25 Nov 2010
**/
26,4 → 26,4
default:
eZDebug::writeError( 'Could not connect to Twitter. Refresh the page or try again later.', 'NXC Twitter Signin' );
}
?>
?>
/extension/nxc_twitter_api/ezinfo.php
1,18 → 1,19
<?php
/**
* @package nxcTwitterAPI
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 10 Mar 2010
**/
 
class nxc_twitter_apiInfo {
class nxc_twitter_apiInfo
{
public static function info() {
return array(
'Name' => 'NXC Twitter API',
'Version' => '1.0',
'Author' => 'Dolgushev Serhey <a href="mailto:serhey.dolgushev@nxc.no" target="blank">&lt;serhey.dolgushev@nxc.no&gt;</a>',
'Copyright' => 'Copyright &copy; 2010 <a href="http://nxc.no" target="blank">NXC Consulting</a>'
'Author' => 'SD / NXC International SA',
'Copyright' => 'Copyright &copy; 2011 <a href="http://nxc.no" target="blank">NXC Consulting</a>'
);
}
}
?>
?>
/extension/nxc_twitter_api/settings/module.ini.append.php
3,4 → 3,4
[ModuleSettings]
ExtensionRepositories[]=nxc_twitter_api
ModuleList[]=nxc_twitter_api
*/ ?>
*/ ?>
/extension/nxc_twitter_api/settings/design.ini.append.php
4,5 → 4,5
DesignExtensions[]=nxc_twitter_api
 
[StylesheetSettings]
CSSFileList[]=nxc_twitter_api.css
*/ ?>
BackendCSSFileList[]=nxc_twitter_api.css
*/ ?>
/extension/nxc_twitter_api/settings/nxctwitter.ini.append.php
1,6 → 1,6
<?php /* #?ini charset="iso-8859-1"?
<?php /* #?ini charset="utf-8"?
 
[TwitterAPI]
Key=kvYRwQrnPeaDfd0kj63WCQ
Secret=KYUMpdSFVvCDoNqqs7l4gSFohurQBW3kZwgT8r7ts
*/ ?>
*/ ?>
/extension/nxc_twitter_api/lib/twitteroauth.php
173,6 → 173,7
* Format and sign an OAuth / API request
*/
function oAuthRequest($url, $method, $parameters) {
$parameters['oauth_timestamp'] = time();
if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) {
$url = "{$this->host}{$url}.{$this->format}";
}
/extension/nxc_twitter_api/settings.php
1,12 → 1,12
<?php
/**
* @package nxcTwitterAPI
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 18 Jan 2010
**/
 
class nxc_twitter_apiSettings extends nxcExtensionSettings {
 
class nxc_twitter_apiSettings extends nxcExtensionSettings
{
public $defaultOrder = 10;
public $dependencies = array();
 
14,4 → 14,4
 
public function deactivate() {}
}
?>
?>
/extension/nxc_twitter_api/autoload/autoload.php
1,22 → 1,22
<?php
/**
* @package nxcTwitterAPI
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 10 Mar 2010
**/
 
return array (
'TwitterOAuth' => './lib/twitter_async/twitteroauth.php',
'OAuthConsumer' => './lib/twitter_async/oauth.php',
'OAuthDataStore' => './lib/twitter_async/oauth.php',
'OAuthException' => './lib/twitter_async/oauth.php',
'OAuthRequest' => './lib/twitter_async/oauth.php',
'OAuthServer' => './lib/twitter_async/oauth.php',
'OAuthSignatureMethod' => './lib/twitter_async/oauth.php',
'TwitterOAuth' => './lib/twitter_async/twitteroauth.php',
'OAuthConsumer' => './lib/twitter_async/oauth.php',
'OAuthDataStore' => './lib/twitter_async/oauth.php',
'OAuthException' => './lib/twitter_async/oauth.php',
'OAuthRequest' => './lib/twitter_async/oauth.php',
'OAuthServer' => './lib/twitter_async/oauth.php',
'OAuthSignatureMethod' => './lib/twitter_async/oauth.php',
'OAuthSignatureMethod_HMAC_SHA1' => './lib/twitter_async/oauth.php',
'OAuthSignatureMethod_PLAINTEXT' => './lib/twitter_async/oauth.php',
'OAuthSignatureMethod_RSA_SHA1' => './lib/twitter_async/oauth.php',
'OAuthToken' => './lib/twitter_async/oauth.php',
'OAuthUtil' => './lib/twitter_async/oauth.php'
'OAuthSignatureMethod_RSA_SHA1' => './lib/twitter_async/oauth.php',
'OAuthToken' => './lib/twitter_async/oauth.php',
'OAuthUtil' => './lib/twitter_async/oauth.php'
);
?>
?>
/extension/nxc_twitter_api/modules/nxc_twitter_api/callback.php
1,6 → 1,6
<?php
/**
* @package nxcTwitterAPI
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 17 Sep 2010
**/
8,7 → 8,8
$http = eZHTTPTool::instance();
$ini = eZINI::instance( 'nxctwitter.ini' );
 
if( $http->hasGetVariable( 'twitter_request_token' ) &&
if(
$http->hasGetVariable( 'twitter_request_token' ) &&
( $http->getVariable( 'twitter_request_token' ) !== $http->sessionVariable( 'twitter_request_token' ) )
) {
$Params['Module']->redirectTo( '/nxc_twitter_api/settings' );
45,4 → 46,4
}
 
$Params['Module']->redirectTo( '/nxc_twitter_api/settings/1' );
?>
?>
/extension/nxc_twitter_api/modules/nxc_twitter_api/settings.php
1,19 → 1,19
<?php
/**
* @package nxcTwitterAPI
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 17 Sep 2010
**/
 
$tpl = eZTemplate::factory();
$tpl->setVariable( 'connected', ( (int) $Params['connected'] === 1 ) );
$tpl->setVariable( 'connected', (int) $Params['connected'] === 1 );
 
$Result = array();
$Result['content'] = $tpl->fetch( 'design:twitter/settings.tpl' );
$Result['path'] = array(
array(
'text' => ezi18n( 'extension/nxc_twitter_api', 'Twitter Settings' ),
'text' => ezpI18n::tr( 'extension/nxc_twitter_api', 'Twitter Settings' ),
'url' => false
)
);
?>
?>
/extension/nxc_twitter_api/modules/nxc_twitter_api/redirect.php
1,11 → 1,10
<?php
/**
* @package nxcTwitterAPI
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 17 Sep 2010
**/
 
 
$http = eZHTTPTool::instance();
$ini = eZINI::instance( 'nxctwitter.ini' );
 
27,4 → 26,4
default:
eZDebug::writeError( 'Could not connect to Twitter. Refresh the page or try again later.', 'NXC Twitter API' );
}
?>
?>
/extension/nxc_twitter_api/modules/nxc_twitter_api/module.php
1,6 → 1,6
<?php
/**
* @package nxcTwitterAPI
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 17 Sep 2010
**/
28,4 → 28,4
 
$FunctionList = array();
$FunctionList['settings'] = array();
?>
?>
/extension/nxc_twitter_feed/ezinfo.php
5,14 → 5,15
* @date 21 May 2010
**/
 
class nxc_twitter_feedInfo {
class nxc_twitter_feedInfo
{
public static function info() {
return array(
'Name' => 'NXC Twitter Feed',
'Version' => '1.0',
'Author' => 'Dolgushev Serhey <a href="mailto:serhey.dolgushev@nxc.no" target="blank">&lt;serhey.dolgushev@nxc.no&gt;</a>',
'Copyright' => 'Copyright &copy; 2010 <a href="http://nxc.no" target="blank">NXC Consulting</a>'
'Author' => 'SD / NXC International SA',
'Copyright' => 'Copyright &copy; 2011 <a href="http://nxc.no" target="blank">NXC Consulting</a>'
);
}
}
?>
?>
/extension/nxc_twitter_feed/settings/module.ini.append.php
4,3 → 4,4
ExtensionRepositories[]=nxc_twitter_feed
ModuleList[]=twitter_feed
*/ ?>
 
/extension/nxc_twitter_feed/settings/block.ini.append.php
8,4 → 8,4
ManualAddingOfItems=disabled
ViewList[]=list
ViewName[list]=List
*/ ?>
*/ ?>
/extension/nxc_twitter_feed/settings/override.ini.append.php
6,4 → 6,4
Subdir=templates
Match[type]=TwitterFeed
Match[view]=list
*/ ?>
*/ ?>
/extension/nxc_twitter_feed/settings/site.ini.append.php
8,4 → 8,4
id=nxc-twitter
tags[]=content
path=nxc-twitter
*/ ?>
*/ ?>
/extension/nxc_twitter_feed/settings.php
5,8 → 5,8
* @date 21 May 2010
**/
 
class nxc_twitter_feedSettings extends nxcExtensionSettings {
 
class nxc_twitter_feedSettings extends nxcExtensionSettings
{
public $defaultOrder = 15;
public $dependencies = array( 'nxc_twitter_api' );
 
14,4 → 14,4
 
public function deactivate() {}
}
?>
?>
/extension/nxc_twitter_feed/autoload/autoload.php
1,6 → 1,6
<?php
/**
* @package nxcTwitterFeed
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 21 Sep 2010
**/
8,4 → 8,4
return array (
'nxcTwitterFeed' => './classes/feed.php'
);
?>
?>
/extension/nxc_twitter_feed/modules/twitter_feed/function_definition.php
1,6 → 1,6
<?php
/**
* @package nxcTwitterFeed
* @package nxcTwitter
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 21 Sep 2010
**/
31,12 → 31,12
);
 
$FunctionList['user_info'] = array(
'name' => 'user_info',
'call_method' => array(
'name' => 'user_info',
'call_method' => array(
'class' => 'nxcTwitterFeed',
'method' => 'getUserInfo'
),
'parameter_type' => 'standard',
'parameters' => array()
'parameter_type' => 'standard',
'parameters' => array()
);
?>
?>
/extension/nxc_twitter_feed/classes/feed.php
1,13 → 1,13
<?php
/**
* @package nxcTwitterFeed
* @package nxcTwitter
* @class nxcTwitterFeed
* @author Serhey Dolgushev <serhey.dolgushev@nxc.no>
* @date 21 Sep 2010
**/
 
class nxcTwitterFeed {
 
class nxcTwitterFeed
{
private $twitterAPI;
private $cacheSettings;
 
33,7 → 33,7
eZDebug::writeError( 'Type "' . $type . '" ins`t allowed', 'NXC Twitter feed' );
return false;
}
 
$cacheFileHandler = eZClusterFileHandler::instance( $this->cacheSettings['path'] . $type . '_timeline.php' );
 
try{
61,25 → 61,23
'extension/twitter_feed', '%secons seconds ago', null, array( '%secons' => ceil( $created_diff ) )
);
} elseif( $created_diff < 60 * 60 ) {
$created_ago = ezi18n(
$created_ago = ezpI18n::tr(
'extension/twitter_feed', '%minutes minutes ago', null, array( '%minutes' => floor( $created_diff / 60 ) )
);
} elseif( $created_diff < 60 * 60 * 24 ) {
$created_ago = ezi18n(
$created_ago = ezpI18n::tr(
'extension/twitter_feed', 'About %hours hours ago', null, array( '%hours' => floor( $created_diff / ( 60 * 60 ) ) )
);
} elseif( $created_diff < 60 * 60 * 24 * 7 ) {
$created_ago = ezi18n(
$created_ago = ezpI18n::tr(
'extension/twitter_feed', 'About %days days ago', null, array( '%days' => floor( $created_diff / ( 60 * 60 * 24 ) ) )
);
} else {
$created_ago = ezi18n(
$created_ago = ezpI18n::tr(
'extension/twitter_feed', 'About %weeks weeks ago', null, array( '%weeks' => floor( $created_diff / ( 60 * 60 * 24 * 7 ) ) )
);
}
 
 
 
$status = self::objectToArray( $status );
$status['created_timestamp'] = $created_at;
$status['created_ago'] = $created_ago;
147,4 → 145,4
return $arr;
}
}
?>
?>