Exemplo n.º 1
0
 public function run($id)
 {
     $model = $this->getModel($id);
     if (isset($_FILES['Profile'])) {
         $model->photo = CUploadedFile::getInstance($model, 'photo');
         if ($model->save()) {
             $html = '';
             $html = "\n                    <div class='refresh-content' data-refresh-selector='.avatar-image'>" . Profile::renderFullSizeAvatar($model->id, 60) . "</div>";
             echo $html;
             Yii::app()->end();
         } else {
             throw new CHttpException(500, Yii::t('app', 'Upload failed'));
         }
     }
     return parent::run($id);
 }
Exemplo n.º 2
0
if (isset($_POST['themeName'])) {
    echo CHtml::hiddenField('themeName', $_POST['themeName']);
}
?>

        <div class="row">
            <div class="cell form-cell" id="login-form-inputs-container">
                </div>
                <?php 
echo X2Html::logo('login_' . (LoginThemeHelper::singleton()->usingDarkTheme ? 'white' : 'black'), array('id' => 'login-form-logo'));
if ($profile) {
    ?>
                <!--<div class='avatar-cell'>
                    <span class='image-alignment-helper'></span>
                    <?php 
    echo Profile::renderFullSizeAvatar($profile->id, 105);
    ?>
                </div>-->
                <?php 
}
if ($profile) {
    ?>
                <div id='full-name'><?php 
    echo $profile->fullName;
    ?>
</div>
                <?php 
}
?>
                <div class='row'>
                <?php 
Exemplo n.º 3
0
        </div>
        <div class="topic-title">
            <?php 
echo $data->getLink();
?>
        </div>
        <div class="topic-attributes">
            <div class="topic-reply-count">
                <?php 
echo $data->renderAttribute('replyCount');
?>
            </div>
            <div class="topic-last-updated">
                <div class='avatar-container'>
                <?php 
echo Profile::renderFullSizeAvatar($data->lastPost->getAuthorId(), 30);
?>
                </div>
                <div class="topic-last-updated-text">
                    <?php 
echo User::getUserLinks($data->lastPost->updatedBy);
?>
<br>
                    <?php 
echo Formatter::formatDateTime($data->lastPost->createDate);
?>
                </div>
            </div>
        </div>
    </div>
</div>
Exemplo n.º 4
0
}
if ($data->type == 'calendar_event') {
    echo X2DateUtil::actionDate($data->timestamp, 1);
}
?>
        <?php 
//  echo ($data->type!='feed')?CHtml::image($imgUrl,'',array('title'=>$data->parseType($data->type))):"";
?>
        <?php 
if ($data->type == 'feed') {
    // add css class to uploaded avatar images to round corners
    $CSSClass = $avatar == 'uploads/default.png' ? 'default-avatar-image' : 'avatar-image';
    if (!empty($avatar) && file_exists($avatar)) {
        echo CHtml::image(Yii::app()->request->baseUrl . "/" . $avatar, '', array('class' => $CSSClass, 'height' => 35, 'width' => 35));
    } else {
        Profile::renderFullSizeAvatar(0, 35);
    }
}
?>
        <div class='stacked-icon'></div>
    </div>
    <div class="event-text-box">
        <div class="deleteButton">
            <?php 
if ($data->type == 'feed' && ($data->user == Yii::app()->user->getName() || Yii::app()->params->isAdmin)) {
    echo CHtml::link('', array('/profile/updatePost', 'id' => $data->id, 'profileId' => $profileId), array('class' => 'fa fa-edit')) . " ";
}
if (($data->user == Yii::app()->user->getName() || $data->associationId == Yii::app()->user->getId()) && $data->type == 'feed' || Yii::app()->params->isAdmin) {
    echo CHtml::link('', '#', array('class' => 'fa fa-close delete-link', 'id' => $data->id . '-delete'));
}
?>
Exemplo n.º 5
0
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
$showComments = !isset($showComments) ? true : $showComments;
$showRecipient = !isset($showRecipient) ? true : $showRecipient;
?>
<div class='record-list-item'>
    <?php 
if (($data->isTypeFeed() || in_array($data->type, array('comment', 'media'))) && $data->profile) {
    ?>
    <div class='event-author'>
        <div class='avatar'>
        <?php 
    echo CHtml::link(Profile::renderFullSizeAvatar($data->profile->id, 45), $data->profile->url);
    ?>
        </div>
        <div class='author-name'>
        <?php 
    echo CHtml::link($data->profile->fullName, $data->profile->url);
    ?>
        </div>
        <?php 
    if ($showRecipient && ($recipient = $data->getRecipient())) {
        ?>
        <div class='recipient-name'>
        <?php 
        echo $recipient;
        ?>
        </div>
Exemplo n.º 6
0
    <div class="form" id="login-form">
        <?php 
if (isset($_POST['themeName'])) {
    echo CHtml::hiddenField('themeName', $_POST['themeName']);
}
?>

        <div class="row">
            <div class="cell form-cell" id="login-form-inputs-container">
                <?php 
if (isset($profileId)) {
    ?>
                <div class='avatar-cell'>
                    <span class='image-alignment-helper'></span>
                    <?php 
    Profile::renderFullSizeAvatar($profileId, 105);
    ?>
                </div>
                <?php 
}
?>
                <?php 
if ($hasProfile) {
    ?>
                <div id='full-name'><?php 
    echo $fullName;
    ?>
</div>
                <?php 
}
if (AuxLib::isIE() && AuxLib::getIEVer() < 10) {
Exemplo n.º 7
0
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
?>

<div id='profile-badge'>
	<span id='profile-avatar'>
	<?php 
echo Profile::renderFullSizeAvatar($this->model->id, 45);
?>
	</span>

	<span id='info'>
	<div id='profile-name'>
		<?php 
echo X2Html::link($this->model->fullName, Yii::app()->controller->createUrl('view', array('id' => $this->model->id, 'publicProfile' => true)));
?>
	</div>

	<!--div id='profile-edit'>
		<!?php echo X2Html::link(
			Yii::t('profile','Edit Profile'),
			Yii::app()->controller->createUrl('update', array(
					'id' => $this->model->id 
Exemplo n.º 8
0
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
Yii::app()->clientScript->registerCss("AvatarCss", "\n\n#profile-image-container {\n    width: 100px;\n    margin-top: 4px;\n    margin: 15px;\n    position: relative;\n}\n\n.file-wrapper {\n    height: 119px;\n    display: block;\n}\n\n\n#avatar-image {\n    display:block;\n}\n\n#photo-upload-overlay {\n    text-align: center;\n    position: absolute;\n    width: 91px;\n    height: 35px;\n    \n    font-weight: bold;\n    font-size: 12px;\n\n    border-radius: 0 0 8px 8px;\n    border-top: none;\n    border: 2px solid rgb(204, 200, 200);\n    \n    color: rgb(95, 94, 94);\n    background: rgb(213, 243, 255);\n\n    opacity:0.7;\n    top: 60px;\n    left: 2px;\n}\n\n#photo-upload-overlay:hover {\n    cursor: pointer;\n}\n\n#photo-upload-overlay span {\n    display: table-cell;\n    vertical-align: middle;\n    width: 97px;\n    height: 35px;\n}\n\n.avatar-upload {\n    -webkit-border-radius:8px;\n    -moz-border-radius:8px;\n    -o-border-radius:8px;\n    border-radius:8px;\n}\n\n#reset-profile-avatar {\n    display:inline-block;\n    text-decoration: none;\n    margin-bottom: 5px;\n    margin-top: 5px;\n\n}\n\n");
Yii::app()->clientScript->registerScript('AvatarJs', "\n\n/**\n * Validate file extension of avatar image. Called during file field onchange event and upon dialog\n * submit.\n * @param object elem a jQuery object corresponding to the file field element\n * @param object submitButton a jQuery object corresponding to the dialog submit button\n * @return bool false if invalid, true otherwise\n */\nfunction validateAvatarFile (elem, submitButton) {\n    var isLegalExtension = false;\n    auxlib.destroyErrorFeedbackBox (elem);\n\n    // get the file name and split it to separate the extension\n    var name = elem.val ();\n\n    // name is valid\n    if (name.match (/.+\\..+/)) {\n        var extension = name.split('.').pop ().toLowerCase ();\n\n        var legalExtensions = ['png','gif','jpg','jpe','jpeg'];        \n        if (\$.inArray (extension, legalExtensions) !== -1)\n            isLegalExtension = true;\n    } else if (name !== '') {\n        var extension = '';\n    }\n\n    if(isLegalExtension) { // enable submit\n        submitButton.addClass ('highlight');\n    } else { // delete the file name, disable Submit, Alert message\n        elem.val ('');\n        if (typeof extension !== 'undefined') {\n            auxlib.createErrorFeedbackBox ({\n                prevElem: elem,\n                message: '" . Yii::t('app', 'Invalid file type.') . "'\n            });\n        } else {\n            auxlib.createErrorFeedbackBox ({\n                prevElem: elem,\n                message: '" . Yii::t('app', 'Please upload a file.') . "'\n            });\n        }\n        submitButton.removeClass ('highlight');\n    }\n        \n    return isLegalExtension;\n}\n\n/**\n * Setup avatar upload UI element behavior \n */\nfunction setUpAvatarUpload () {\n\n    // hide/show overlay\n    \$('#profile-image-container').mouseover (function () {\n        \$('#photo-upload-overlay').show ();\n    }).mouseleave (function (evt) {\n        if (\$(evt.relatedTarget).closest ('#avatar-image').length === 0 &&\n            \$(evt.relatedTarget).closest ('#photo-upload-overlay span').length === 0)\n            \$('#photo-upload-overlay').hide ();\n    });\n\n    // instantiate image upload dialog\n    \$('#photo-upload-overlay').click (function () {\n        \$('#photo-upload-dialog').dialog ({\n            title: '" . Yii::t('app', 'Upload an Avatar Photo') . "',\n            autoOpen: true,\n            width: 500,\n            buttons: [\n                {\n                    text: '" . Yii::t('app', 'Submit') . "',\n                    'class': 'photo-upload-dialog-submit-button',\n                    click: function () {\n                        if (validateAvatarFile (\n                            \$('#avatar-photo-file-field'), \n                            \$('.photo-upload-dialog-submit-button'))) {\n\n                            \$('#photo-form').submit ();\n                        }\n                    }\n                },\n                {\n                    text: '" . Yii::t('app', 'Cancel') . "',\n                    click: function () {\n                        \$(this).dialog ('close');\n                    }\n                }\n            ],\n            close: function () {\n                \$('#photo-upload-dialog').hide ();\n                \$(this).dialog ('destroy');\n                auxlib.destroyErrorFeedbackBox (\$('#avatar-photo-file-field'));\n            }\n        });\n    });\n}\n\n\$(function() {\n    setUpAvatarUpload ();\n});\n\n", CClientScript::POS_HEAD);
?>
<div id='profile-image-container'>
<?php 
echo Profile::renderFullSizeAvatar($id);
if ($editable) {
    ?>
    <div id='photo-upload-overlay' style='display:none;'>
        <span><?php 
    echo Yii::t('app', 'Change Avatar');
    ?>
</span>
    </div>
	<?php 
}
$url = Yii::app()->createUrl("profile/uploadPhoto", array('id' => $id, 'clear' => true));
?>
    <?php 
if (Profile::model()->findByPk($id)->avatar) {
    ?>
Exemplo n.º 9
0
        $fileName = 'products';
    }
    if ($fileName == 'quote') {
        $fileName = 'quotes';
    }
    if (file_exists('themes/' . Yii::app()->theme->name . '/images/' . $fileName . '.png')) {
        // echo "<div class='img-box plus-sign'></div>";
    }
}
if ($data->type == 'calendar_event') {
    echo X2DateUtil::actionDate($data->timestamp, 1);
}
?>
        <?php 
if ($data->isTypeFeed()) {
    echo Profile::renderFullSizeAvatar($profId, 35);
}
?>
        <div class='stacked-icon'></div>
    </div>
    <div class="event-text-box">
        <div class="deleteButton">
            <?php 
if ($data->isTypeFeed() && ($data->user == Yii::app()->user->getName() || Yii::app()->params->isAdmin)) {
    echo CHtml::link('', array('/profile/updatePost', 'id' => $data->id, 'profileId' => $profileId), array('class' => 'fa fa-edit')) . " ";
}
if (($data->user == Yii::app()->user->getName() || $data->associationId == Yii::app()->user->getId()) && $data->isTypeFeed() || Yii::app()->params->isAdmin) {
    echo CHtml::link('', '#', array('class' => 'fa fa-close delete-link', 'id' => $data->id . '-delete'));
}
?>
        </div>
Exemplo n.º 10
0
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
//Yii::app()->clientScript->registerCssFile(
//    Yii::app()->controller->assetsUrl.'/css/recordView.css');
if ($model instanceof Profile) {
    ?>
<div class='profile-header'>    
    <div class='avatar'>
        <?php 
    $this->beginWidget('MobileActiveForm');
    echo Profile::renderFullSizeAvatar($model->id, 120);
    $this->endWidget();
    ?>
    </div>
    <div class='full-name'>
    <?php 
    echo CHtml::encode($model->fullName);
    ?>
    </div>
</div>
<?php 
}
?>
<div class='detail-view'>
<?php 
$mobileLayout = MobileLayouts::getMobileLayout(get_class($model));
Exemplo n.º 11
0
    echo X2Html::link('', Yii::app()->controller->createUrl('/topics/topics/updateReply', array('id' => $data->id)), array('class' => 'x2-button icon edit right'));
}
?>
        </div>
        <div class="clear-fix"></div><br>
    </div>
    <div class="topic-content clear-fix">
        <div class="reply-user-info">
            <div class="reply-username">
                <?php 
echo User::getUserLinks($data->assignedTo);
?>
            </div>
            <div class="img-box user-avatar">
                <?php 
echo Profile::renderFullSizeAvatar($data->getAuthorId(), 45);
?>
            </div>
        </div>
        <div class='topic-text'>
            <div class='topic-timestamp-text'>
                <?php 
echo Yii::t('topics', 'Posted {datetime}.', array('{datetime}' => Formatter::formatDateTime($data->createDate, 'medium')));
?>
            </div>
            <br>
            <?php 
echo Formatter::convertLineBreaks(x2base::convertUrls($data->text));
?>
            <div class='topic-timestamp-text'>
                <br>
Exemplo n.º 12
0
?>
        </div>
        <div class="topic-title">
            <?php 
echo $data->getLink();
?>
        </div>
        <div class="topic-attributes">
            <div class="topic-reply-count">
                <?php 
echo $data->renderAttribute('replyCount');
?>
            </div>
            <div class="topic-last-updated">
                <?php 
echo Profile::renderFullSizeAvatar($data->originalPost->getAuthorId(), 30);
?>
                <div class="topic-last-updated-text">
                    <?php 
echo User::getUserLinks($data->lastPost->updatedBy);
?>
<br>
                    <?php 
echo Formatter::formatDateTime($data->lastPost->createDate);
?>
                </div>
            </div>
        </div>
    </div>
</div>