Exemplo n.º 1
0
Arquivo: Post.php Projeto: vijo/movim
 function ajaxTogglePrivacy($id)
 {
     $validate = Validator::string()->length(6, 128);
     if (!$validate->validate($id)) {
         return;
     }
     $pd = new \Modl\PrivacyDAO();
     $p = $pd->get($id);
     $pd = new \Modl\PostnDAO();
     $po = $pd->getItem($id);
     if ($po->isMine()) {
         if ($po->privacy == 1) {
             Notification::append(false, $this->__('post.public_no'));
             \Modl\Privacy::set($id, 0);
         }
         if ($po->privacy == 0) {
             Notification::append(false, $this->__('post.public_yes'));
             \Modl\Privacy::set($id, 1);
         }
     }
 }
Exemplo n.º 2
0
 function ajaxChangePrivacy($value)
 {
     if ($value == true) {
         \modl\Privacy::set($this->user->getLogin(), 1);
         Notification::append(null, $this->__('vcard.public'));
     } else {
         \modl\Privacy::set($this->user->getLogin(), 0);
         Notification::append(null, $this->__('vcard.restricted'));
     }
 }