コード例 #1
0
 /** Possible actions for a user: edit, view participants, call, archive, delete */
 function user_actions($user_id)
 {
     $CI =& get_instance();
     $u = $CI->userModel->get_user_by_id($user_id);
     $edit_link = anchor('user/edit/' . $u->id, img_edit());
     $act_link = is_activated($u) ? anchor('user/deactivate/' . $u->id, img_active(TRUE)) : anchor('user/activate/' . $u->id, img_active(FALSE));
     $delete_link = is_admin($u) ? img_delete(TRUE) : anchor('user/delete/' . $u->id, img_delete(), warning(lang('sure_delete_user')));
     return implode(' ', array($edit_link, $act_link, $delete_link));
 }
コード例 #2
0
 /** Returns the activation link for a participant */
 function participant_activate_link($participant, $text = '')
 {
     if (!$participant->activated) {
         $activate_link = anchor('participant/activate/' . $participant->id, $text ? $text : img_active(FALSE));
         if ($participant->deactivated_reason == DeactivateReason::NewParticipant) {
             return $activate_link;
         } else {
             return $text ? $text : $activate_link;
         }
     } else {
         return anchor('participant/deactivate/' . $participant->id, $text ? $text : img_active(TRUE));
     }
 }