PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/profile/views/privacy/update.php

https://github.com/yii-simon/yii-user-management
PHP | 180 lines | 153 code | 27 blank | 0 comment | 14 complexity | 9b7e58ab51f659122e403200bd4919e0 MD5 | raw file
  1. <?
  2. $this->breadcrumbs=array(
  3. Yum::t('Privacysettings')=>array('index'),
  4. $model->user->username=>array(
  5. '//user/user/view','id'=>$model->user_id),
  6. Yum::t( 'Update'),
  7. );
  8. $this->title = Yum::t('Privacy settings for {username}', array(
  9. '{username}' => $model->user->username));
  10. ?>
  11. <div class="form">
  12. <p class="note">
  13. <? Yum::requiredFieldNote(); ?>
  14. </p>
  15. <? $form=$this->beginWidget('CActiveForm', array(
  16. 'id'=>'privacysetting-form',
  17. 'enableAjaxValidation'=>true,
  18. ));
  19. echo $form->errorSummary($model);
  20. ?>
  21. <div class="profile_field_selection">
  22. <?
  23. echo '<h3>' . Yum::t('Profile field public options') . '</h3>';
  24. echo '<p>' . Yum::t('Select the fields that should be public') . ':</p>';
  25. $i = 1;
  26. $counter=0;
  27. foreach(YumProfileField::model()->findAll() as $field) {
  28. $counter++;
  29. if ($counter==1)echo '<div class="float-left" style="width: 175px;">';
  30. printf('<div>%s<label class="profilefieldlabel" for="privacy_for_field_%d">%s</label></div>',
  31. CHtml::checkBox("privacy_for_field_{$i}",
  32. $model->public_profile_fields & $i),
  33. $i,
  34. Yum::t($field->title)
  35. );
  36. $i *= 2;
  37. if ($counter%4==0) echo '</div><div class="float-left" style="width: 175px;">';
  38. }
  39. if ($counter%4!=0) echo '</div>';
  40. echo '<div class="clear"></div>';
  41. ?>
  42. </div>
  43. <? if(Yum::hasModule('friendship')) { ?>
  44. <div class="row">
  45. <? echo $form->labelEx($model,'message_new_friendship'); ?>
  46. <? echo $form->dropDownList($model, 'message_new_friendship', array(
  47. 0 => Yum::t('No'),
  48. 1 => Yum::t('Yes'))); ?>
  49. <? echo $form->error($model,'message_new_friendship'); ?>
  50. </div>
  51. <? } ?>
  52. <div class="row">
  53. <? echo $form->labelEx($model,'message_new_message'); ?>
  54. <? echo $form->dropDownList($model, 'message_new_message', array(
  55. 0 => Yum::t('No'),
  56. 1 => Yum::t('Yes'))); ?>
  57. <? echo $form->error($model,'message_new_message'); ?>
  58. </div>
  59. <? if(Yum::module('profile')->enableProfileComments) { ?>
  60. <div class="row">
  61. <?
  62. echo CHtml::activeLabelEx($profile, 'allow_comments');
  63. echo CHtml::activeDropDownList($profile, 'allow_comments',
  64. array(
  65. '0' => Yum::t( 'No'),
  66. '1' => Yum::t( 'Yes'),
  67. )
  68. );
  69. ?>
  70. </div>
  71. <div class="row message_new_profilecomment">
  72. <? echo $form->labelEx($model,'message_new_profilecomment'); ?>
  73. <? echo $form->dropDownList($model, 'message_new_profilecomment', array(
  74. 0 => Yum::t('No'),
  75. 1 => Yum::t('Yes'))); ?>
  76. <? echo $form->error($model,'message_new_profilecomment'); ?>
  77. </div>
  78. <? } ?>
  79. <? if(Yum::hasModule('friendship')) { ?>
  80. <div class="row">
  81. <?
  82. echo CHtml::activeLabelEx($profile, 'show_friends');
  83. echo CHtml::activeDropDownList($profile, 'show_friends',
  84. array(
  85. '0' => Yum::t( 'do not make my friends public'),
  86. '2' => Yum::t( 'make my friends public'),
  87. )
  88. );
  89. ?>
  90. </div>
  91. <? } ?>
  92. <? if(Yum::module()->enableOnlineStatus) { ?>
  93. <div class="row">
  94. <?
  95. echo CHtml::activeLabelEx($model, 'show_online_status');
  96. echo CHtml::activeDropDownList($model, 'show_online_status',
  97. array(
  98. '0' => Yum::t( 'Do not show my online status'),
  99. '1' => Yum::t( 'Show my online status to everyone'),
  100. )
  101. );
  102. ?>
  103. </div>
  104. <? } ?>
  105. <div class="row">
  106. <?
  107. echo CHtml::activeLabelEx($model, 'log_profile_visits');
  108. echo CHtml::activeDropDownList($model, 'log_profile_visits',
  109. array(
  110. '0' => Yum::t( 'Do not show the owner of a profile when i visit him'),
  111. '1' => Yum::t( 'Show the owner when i visit his profile'),
  112. )
  113. );
  114. ?>
  115. </div>
  116. <? if(Yum::hasModule('role')) { ?>
  117. <div class="row">
  118. <?
  119. echo CHtml::activeLabelEx($model, 'appear_in_search');
  120. echo CHtml::activeDropDownList($model, 'appear_in_search',
  121. array(
  122. '0' => Yum::t( 'Do not appear in search'),
  123. '1' => Yum::t( 'Appear in search'),
  124. )
  125. );
  126. ?>
  127. </div>
  128. <? } ?>
  129. <div class="row">
  130. <? echo $form->labelEx($model,'ignore_users'); ?>
  131. <? echo $form->textField($model, 'ignore_users', array('size' => 100)); ?>
  132. <? echo $form->error($model,'ignore_users'); ?>
  133. <div class="hint">
  134. <p> <? echo Yum::t('Separate usernames with comma to ignore specified users'); ?> </p>
  135. </div>
  136. </div>
  137. <?
  138. echo CHtml::Button(Yum::t( 'Cancel'), array(
  139. 'submit' => array('//profile/profile/view')));
  140. echo CHtml::submitButton(Yum::t('Save'));
  141. $this->endWidget(); ?>
  142. </div> <!-- form -->
  143. <? Yii::app()->clientScript->registerScript('profile_toggle', "
  144. if($('#YumProfile_allow_comments').val() == '0')
  145. $('.message_new_profilecomment').hide();
  146. $('#YumProfile_allow_comments').change(function () {
  147. if($(this).val() == '0')
  148. $('.message_new_profilecomment').hide(500);
  149. if($(this).val() == '1')
  150. $('.message_new_profilecomment').show(500);
  151. });
  152. ");
  153. ?>