Beispiel #1
0
 public static function dynamicEditProfileLink($params)
 {
     if (Yii::app()->user->id == $params['id']) {
         $registerModel = ModelRegister::model()->find('widget_id > 0');
         if ($registerModel) {
             return '<p>' . CHtml::link(Yii::t('UnitProfiles.main', 'Edit profile'), $registerModel->getWidgetUrl()) . '</p>';
         }
     }
     return '';
 }
Beispiel #2
0
                })
                .css({ 'position': 'fixed',
                    'marginTop': '10px',
                    'left': Math.ceil(\$('body').width()/2-125)+'px',
                    'width': '300px',
                    'z-index': '100000'
                });


JS
, CClientScript::POS_READY);
$js = '';
$flashes = Yii::app()->user->getFlashes(false);
$unitConfig = ContentUnit::loadConfig();
if (Yii::app()->user->hasState('askfill') && isset($unitConfig['register'])) {
    $registerModel = ModelRegister::model()->find('widget_id > 0');
    if ($registerModel) {
        $shortMessage = '<a href=\'' . $registerModel->getWidgetUrl() . '\'>' . Yii::t('cms', 'Please fill all required fields in your personal profile. And if necessary, change your password.') . '</a>';
        $message = '<h3>' . Yii::t('cms', 'Attention') . '</h3><p>' . $shortMessage . '</p>';
        if (Yii::app()->user->getState('askfill') == 'first') {
            $fancyPath = $am->publish(Yii::getPathOfAlias('application.vendors.fancybox'));
            $cs->registerScriptFile($fancyPath . '/jquery.fancybox-1.3.1.pack.js');
            $cs->registerCssFile($fancyPath . '/jquery.fancybox-1.3.1.css');
            $js .= '$.fancybox("' . $message . '");';
            Yii::app()->user->setState('askfill', 'second');
        } else {
            $flashes['askfill-permanent'] = $shortMessage;
        }
    }
}
foreach ($flashes as $k => $flash) {