Example #1
0
 /**
  * Creates a page button.
  *
  * You may override this method to customize the page buttons.
  * @param string $label the text label for the button
  * @param integer $page the page number
  * @param string $class the CSS class for the page button. This could be 'page', 'first', 'last', 'next' or 'previous'.
  * @param boolean $hidden whether this page button is visible
  * @param boolean $selected whether this page button is selected
  *
  * @return string the generated button
  */
 protected function createPageButton($label, $page, $class, $hidden, $selected)
 {
     $this->ajaxIdCounter++;
     // For Unique Ajax Link IDs
     if ($hidden || $selected) {
         $class .= ' ' . ($hidden ? self::CSS_HIDDEN_PAGE : self::CSS_SELECTED_PAGE);
     }
     $ajaxLink = HHtml::ajaxLink($label, $this->createPageUrl($page), array('success' => "function(html) { jQuery('" . $this->ajaxContentTarget . "').replaceWith(html); }"), array('id' => "siPaginatorLink_" . $page . "_" . $this->ajaxIdCounter));
     return '<li class="' . $class . '">' . $ajaxLink . '</li>';
 }
Example #2
0
}
?>

        <div class="clearFloats"></div>

        <?php 
echo CHtml::endForm();
?>

        <?php 
if ($poll->hasUserVoted()) {
    ?>
            <br>
            <?php 
    $voteUrl = CHtml::normalizeUrl(array('/polls/poll/answerReset', 'sguid' => $space->guid, 'pollId' => $poll->id, 'wallType' => Wall::$currentType));
    echo HHtml::ajaxLink(Yii::t('PollsModule.widgets_views_entry', 'Reset my vote'), $voteUrl, array('dataType' => 'json', 'success' => "function(json) { \$('#wallEntry_'+json.wallEntryId).html(parseHtml(json.output)); \$('#wallEntry_'+json.wallEntryId).find(':checkbox, :radio').flatelements(); }"), array('id' => "PollAnswerResetButton_" . $poll->id, 'class' => 'btn btn-danger'));
    ?>
            <br>
        <?php 
}
?>


        <?php 
$this->endContent();
?>

    </div>

</div>
    <?php 
if ($canWrite || $canDelete) {
    ?>

        <ul class="nav nav-pills preferences">
            <li class="dropdown ">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-angle-down"></i></a>

                <ul class="dropdown-menu pull-right">

                    <?php 
    if ($canWrite) {
        ?>
                        <li>
                            <?php 
        echo HHtml::ajaxLink('<i class="fa fa-pencil"></i> ' . Yii::t('CommentModule.widgets_views_showComment', 'Edit'), Yii::app()->createAbsoluteUrl('//comment/comment/edit', array('contentModel' => $comment->object_model, 'contentId' => $comment->object_id, 'id' => $comment->id)), array('success' => "js:function(html){ \$('.preferences .dropdown').removeClass('open'); \$('#comment_editarea_" . $comment->id . "').replaceWith(html); \$('#comment_input_" . $comment->id . "_contenteditable').focus(); }"));
        ?>
                        </li>
                    <?php 
    }
    ?>

                    <?php 
    if ($canDelete) {
        ?>
                        <li>

                            <!-- load modal confirm widget -->
                            <?php 
        $this->widget('application.widgets.ModalConfirmWidget', array('uniqueID' => 'modal_commentdelete_' . $comment->id, 'linkOutput' => 'a', 'title' => Yii::t('CommentModule.widgets_views_showComment', '<strong>Confirm</strong> comment deleting'), 'message' => Yii::t('CommentModule.widgets_views_showComment', 'Do you really want to delete this comment?'), 'buttonTrue' => Yii::t('CommentModule.widgets_views_showComment', 'Delete'), 'buttonFalse' => Yii::t('CommentModule.widgets_views_showComment', 'Cancel'), 'linkContent' => '<i class="fa fa-trash-o"></i> ' . Yii::t('CommentModule.widgets_views_showComment', 'Delete'), 'linkHref' => $this->createUrl("//comment/comment/delete", array('contentModel' => $comment->object_model, 'contentId' => $comment->object_id, 'id' => $comment->id)), 'confirmJS' => "function(html) { \$('#comment_" . $comment->id . "').slideUp(); }"));
        ?>
Example #4
0
                    </div>
                    <hr>
                    <div class="row">
                        <div class="col-md-4">
                            <?php 
echo HHtml::ajaxSubmitButton(Yii::t('UserModule.views_auth_login', 'Sign in'), array('//user/auth/login'), array('type' => 'POST', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => 'btn btn-primary', 'id' => 'loginBtn'));
?>
                        </div>
                        <div class="col-md-8 text-right">
                            <small>
                                <?php 
echo Yii::t('UserModule.views_auth_login', 'Forgot your password?');
?>
                                <br/>
                                <?php 
echo HHtml::ajaxLink(Yii::t('UserModule.views_auth_login', 'Create a new one.'), array('//user/auth/recoverPassword'), array('type' => 'POST', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => '', 'id' => 'recoverPasswordBtn'));
?>
                            </small>
                        </div>
                    </div>

                    <?php 
$this->endWidget();
?>
                </div>

                <?php 
if ($canRegister) {
    ?>
                    <div class="tab-pane <?php 
    echo isset($_POST['AccountRegisterForm']) ? "active" : "";
Example #5
0
<div class="well well-small" style="display: none;" id="comment_<?php 
echo $id;
?>
">
    <div class="comment" id="comments_area_<?php 
echo $id;
?>
">
        <?php 
if ($isLimited) {
    ?>
            <?php 
    // Create an ajax link, which loads all comments upon request
    $showAllLabel = Yii::t('CommentModule.widgets_views_comments', 'Show all {total} comments.', array('{total}' => $total));
    $reloadUrl = CHtml::normalizeUrl(Yii::app()->createUrl('comment/comment/show', array('model' => $modelName, 'id' => $modelId)));
    echo HHtml::ajaxLink($showAllLabel, $reloadUrl, array('success' => "function(html) { \$('#comments_area_" . $id . "').html(html); }"), array('id' => $id . "_showAllLink", 'class' => 'show show-all-link'));
    ?>
            <hr>
        <?php 
}
?>

        <?php 
foreach ($comments as $comment) {
    ?>
            <?php 
    $this->widget('application.modules_core.comment.widgets.ShowCommentWidget', array('comment' => $comment));
    ?>
        <?php 
}
?>
<li>
    <?php 
$offLinkId = 'notification_off_' . $content->getUniqueId();
$onLinkId = 'notification_on_' . $content->getUniqueId();
echo HHtml::ajaxLink('<i class="fa fa-bell-slash-o"></i> ' . Yii::t('ContentModule.widgets_views_notificationSwitchLink', 'Turn off notifications'), Yii::app()->createUrl('//wall/content/notificationSwitch', array('id' => $content->id, 'className' => get_class($content), 'switch' => 0)), array('dataType' => 'json', 'type' => 'POST', 'data' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => "js:function(res){ if (res.success) { \$('#" . $offLinkId . "').hide(); \$('#" . $onLinkId . "').show(); } }"), array('style' => 'display: ' . ($state ? 'block' : 'none'), 'id' => $offLinkId));
?>
    <?php 
echo HHtml::ajaxLink('<i class="fa fa-bell-o"></i> ' . Yii::t('ContentModule.widgets_views_notificationSwitchLink', 'Turn on notifications'), Yii::app()->createUrl('//wall/content/notificationSwitch', array('id' => $content->id, 'className' => get_class($content), 'switch' => 1)), array('dataType' => 'json', 'type' => 'POST', 'data' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => "js:function(res){ if (res.success) { \$('#" . $onLinkId . "').hide(); \$('#" . $offLinkId . "').show(); } }"), array('style' => 'display: ' . ($state ? 'none' : 'block'), 'id' => 'notification_on_' . $content->getUniqueId()));
?>
</li>
Example #7
0
<?php

/**
 * This view shows the edit link for wall entries.
 * Its used by EditLinkWidget.
 *
 * @property string $id the primary key of the model (e.g. 1)
 * @property string $editRoute the route to the edit action
 * @property HActiveRecordContent $object the record which belongs the edit link to
 *
 * @package humhub.modules_core.wall.widgets
 * @since 0.10
 */
?>
<li>
    <?php 
echo HHtml::ajaxLink('<i class="fa fa-pencil"></i> ' . Yii::t('WallModule.widgets_views_editLink', 'Edit'), Yii::app()->createUrl($editRoute, array('id' => $id, 'wallType' => Wall::$currentType)), array('success' => "js:function(html){ \$('.preferences .dropdown').removeClass('open'); \$('#wall_content_" . $object->getUniqueId() . "').replaceWith(html); }"));
?>
</li>
Example #8
0
                            
                <?php 
echo $form->textField($model, 'verifyCode', array('class' => 'form-control', 'placeholder' => Yii::t('UserModule.views_auth_recoverPassword', 'enter security code above')));
?>
                <?php 
echo $form->error($model, 'verifyCode');
?>
            </div>

            <hr>
            <?php 
echo HHtml::ajaxSubmitButton(Yii::t('UserModule.views_auth_recoverPassword', 'Reset password'), array('//user/auth/recoverPassword'), array('type' => 'POST', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => 'btn btn-primary', 'id' => 'recoverPasswordBtn'));
?>
            
            <?php 
echo HHtml::ajaxLink(Yii::t('UserModule.views_auth_recoverPassword', 'Back'), array('//user/auth/login'), array('type' => 'POST', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => 'btn btn-primary', 'id' => 'backBtn'));
?>
            <?php 
$this->endWidget();
?>
        </div>

    </div>
</div>    


<script type="text/javascript">
<?php 
if ($form->errorSummary($model) != null) {
    ?>
        $('#password-recovery-form').removeClass('bounceIn');
Example #9
0
</a> <small><?php 
echo HHtml::timeago($comment->created_at);
?>
</small></h4>
        <span class="content">
            <?php 
print HHtml::enrichText($comment->message);
?>
        </span>

        <?php 
//echo CHtml::link(Yii::t('CommentModule.widgets_views_showComment', "Delete"), '#');
?>

        <div class="wall-entry-controls">
            <?php 
if ($comment->canDelete()) {
    $deleteUrl = CHtml::normalizeUrl(array('//comment/comment/delete', 'model' => $comment->object_model, 'id' => $comment->object_id, 'cid' => $comment->id));
    echo HHtml::ajaxLink(Yii::t('CommentModule.widgets_views_showComment', 'Delete'), $deleteUrl, array('type' => 'POST', 'data' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => "function(html) { \$('#comments_area_" . $comment->object_model . "_" . $comment->object_id . "').html(html); }"), array('id' => "comment_delete_link" . $comment->id));
    echo " - ";
}
?>

            <?php 
Yii::app()->getController()->widget('application.modules_core.like.widgets.LikeLinkWidget', array('object' => $comment));
?>
        </div>
    </div>
</div>
<hr>
Example #10
0
<div class="showMore">
    <?php 
echo HHtml::ajaxLink(Yii::t('CommentModule.widgets_views_pagination', "Show %count% more comments", array('%count%' => $moreCount)), $showMoreUrl, array('success' => "function(html) { \$('#comments_area_" . $id . "').find('.showMore').hide(); \$('#comments_area_" . $id . "').prepend(html);    }"), array('id' => $id . "_pagePrevLink"));
?>
    <hr />
</div>