Example #1
0
<?php

$this->pageTitle = Yii::app()->name . ' - ' . Yii::t('global', 'Login');
$this->breadcrumbs = array(Yii::t('global', 'Login'));
?>
<h1><?php 
echo Yii::t('global', 'Login');
?>
</h1>
<?php 
if (_xls_facebook_login()) {
    ?>
	<?php 
    $this->widget('ext.yii-facebook-opengraph.plugins.LoginButton', array('show_faces' => false, 'size' => 'large', 'text' => Yii::t('global', 'Log in with Facebook'), 'scope' => 'email,user_location,publish_actions', 'on_login' => 'window.location.href="' . Yii::app()->createUrl('facebook/create') . '";'));
}
?>
<div class="login">
	<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'login-form', 'enableClientValidation' => false, 'focus' => array($model, 'email')));
?>
	<div class="row midrow">
		<div class="col-sm-4">
			<?php 
echo $form->labelEx($model, 'email');
?>
			<?php 
echo $form->textField($model, 'email');
?>
			<?php 
echo $form->error($model, 'email');
?>
Example #2
0
<h1 class="registerHeader"><?php 
echo Yii::t('global', $model->id > 0 ? 'Update your account' : 'Create a Free Account!');
?>
</h1>

<?php 
/* Create a new wish list form. We use the Checkout ID to reuse our CSS formatting */
?>

<div id="checkout" class="register">
<?php 
if (_xls_facebook_login() && $model->id == 0) {
    ?>
	<fieldset class="col-sm-12">
		<h3><?php 
    echo Yii::t('checkout', 'Make it simple. Register with your Facebook login.');
    ?>
</h3>
		<?php 
    $this->widget('ext.yii-facebook-opengraph.plugins.LoginButton', array('show_faces' => true, 'size' => 'large', 'text' => Yii::t('global', 'Register using my Facebook account'), 'scope' => 'email,user_location,publish_actions', 'on_login' => 'window.location.href="' . Yii::app()->createUrl('facebook/create') . '";'));
    ?>
	</fieldset>
	<h3 id="signup"><?php 
    echo Yii::t('global', 'Or sign up manually');
    ?>
</h3>
<?php 
}
?>

<?php 
Example #3
0
		</div><!-- end of top row -->

		<div class="row-fluid">
			<div class="description">
					<h2><?php 
echo Yii::t('product', 'Product Description');
?>
</h2>
					<?php 
echo CHtml::tag('div', array('id' => CHtml::activeId($model, 'description_long'), 'class' => 'description'), $model->WebLongDescription);
?>
			</div>

			<div class="facebook_comments">
				<?php 
if (_xls_facebook_login() && _xls_get_conf('FACEBOOK_COMMENTS')) {
    ?>
				<h2><?php 
    echo Yii::t('product', 'Comments about this product');
    ?>
</h2>
				   <?php 
    $this->widget('ext.yii-facebook-opengraph.plugins.Comments', array('href' => $this->CanonicalUrl));
    ?>
				<?php 
}
?>
			</div>


Example #4
0
 protected function afterRender($view, &$output)
 {
     parent::afterRender($view, $output);
     //Yii::app()->facebook->addJsCallback($js); // use this if you are registering any $js code you want to run asyc
     if (_xls_facebook_login()) {
         Yii::app()->facebook->initJs($output);
         // this initializes the Facebook JS SDK on all pages
     }
     return true;
 }
<?php

if (_xls_facebook_login() && _xls_get_conf('FACEBOOK_CHECKOUT')) {
    ?>
<div class="row-fluid">
	<div id='fb-root'></div>
	<script src='http://connect.facebook.net/en_US/all.js'></script>

	<div class="span10 clearfix facebook_wall">
		<div class="row-fluid">
			<div class="span2"><?php 
    echo CHtml::image(Yii::app()->baseUrl . "/images/facebook.png", "Facebook");
    ?>
</div>
			<div class="span10"><h4><?php 
    echo Yii::t('facebook', _xls_get_conf('FACEBOOK_WALL_PUBLISH'));
    ?>
</h4>
				<?php 
    echo CHtml::textArea('msg', Yii::t('facebook', _xls_get_conf('FACEBOOK_WALL_CAPTION'), array("{storename}" => _xls_get_conf('STORE_NAME'))));
    ?>
</div>
		</div>
		<div class="row-fluid">
			<div id="submitSpinner" class="span3" style="display:none">
				<?php 
    echo CHtml::image(Yii::app()->getBaseUrl(true) . '/images/wait_animated.gif');
    ?>
			</div>
			<div class="span5 pull-right">
				<?php 
 /**
  * Logs out the current user and redirect to homepage.
  */
 public function actionLogout()
 {
     Yii::app()->user->logout();
     if (Yii::app()->isCommonSSL) {
         $url = Yii::app()->createUrl("site/logout");
         $url = str_replace("https://" . Yii::app()->params['LIGHTSPEED_HOSTING_LIGHTSPEED_URL'], "http://" . Yii::app()->params['LIGHTSPEED_HOSTING_CUSTOM_URL'], $url);
     } else {
         $url = $this->createAbsoluteUrl("site/index", array(), 'http');
     }
     if (_xls_facebook_login()) {
         $url = Yii::app()->facebook->getLogoutUrl(array('next' => $url, 'access_token' => Yii::app()->facebook->accessToken));
         Yii::app()->facebook->destroySession();
     }
     $this->redirect($url);
 }