Ejemplo n.º 1
0
 /**
  * Displays the field for edit.
  *
  * @author  Jason Rey <*****@*****.**>
  * @since   1.3
  * @access  public
  * @param   array           $post       The posted data.
  * @param   SocialCluster   $cluster    The cluster object.
  * @param   array           $errors     The errors array.
  * @return  string                      The html codes for this field.
  */
 public function onEdit(&$post, &$cluster, $errors)
 {
     $value = isset($post['allowmaybe']) ? (bool) $post['allowmaybe'] : $cluster->getParams()->get('allowmaybe', true);
     $error = $this->getError($errors);
     $this->set('error', $error);
     $this->set('value', $value);
     return $this->display();
 }
Ejemplo n.º 2
0
 /**
  * Displays the field for edit.
  *
  * @author  Jason Rey <*****@*****.**>
  * @since   1.3
  * @access  public
  * @param   array           $post       The posted data.
  * @param   SocialCluster   $cluster    The cluster object.
  * @param   array           $errors     The errors array.
  * @return  string                      The html codes for this field.
  */
 public function onEdit(&$post, &$cluster, $errors)
 {
     $value = isset($post['guestlimit']) ? (int) $post['guestlimit'] : (int) $cluster->getParams()->get('guestlimit', 0);
     $error = $this->getError($errors);
     $this->set('error', $error);
     $this->set('value', $value);
     return $this->display();
 }
Ejemplo n.º 3
0
 /**
  * Displays the field for edit.
  *
  * @author  Jason Rey <*****@*****.**>
  * @since   1.3
  * @access  public
  * @param   array           $post       The posted data.
  * @param   SocialCluster   $cluster    The cluster object.
  * @param   array           $errors     The errors array.
  * @return  string                      The html codes for this field.
  */
 public function onEdit(&$post, &$cluster, $errors)
 {
     $params = $cluster->getParams();
     // Get the real value for this item
     $value = isset($post['event_allday']) ? $post['event_allday'] : $cluster->isAllDay();
     // Get the error.
     $error = $this->getError($errors);
     // Set the value.
     $this->set('value', $this->escape($value));
     $this->set('error', $error);
     return $this->display();
 }
Ejemplo n.º 4
0
 /**
  * Executes before the event is saved.
  *
  * @author  Jason Rey <*****@*****.**>
  * @since   1.3
  * @access  public
  * @param   array           $post       The posted data.
  * @param   SocialCluster   $cluster    The cluster object.
  */
 public function onEditBeforeSave(&$post, &$cluster)
 {
     // We need to know if the news app is published
     if (!$this->appEnabled()) {
         return;
     }
     // Get the posted value
     $value = isset($post[$this->inputName]) ? $post[$this->inputName] : $params->get('news', $this->params->get('default'));
     $value = (bool) $value;
     $registry = $cluster->getParams();
     $registry->set('news', $value);
     $cluster->params = $registry->toString();
     unset($post[$this->inputName]);
 }
Ejemplo n.º 5
0
 /**
  * Executes before the event is saved.
  *
  * @author  Jason Rey <*****@*****.**>
  * @since   1.3
  * @access  public
  * @param   array           $post       The posted data.
  * @param   SocialCluster   $cluster    The cluster object.
  */
 public function onEditBeforeSave(&$post, &$cluster)
 {
     // Get the posted value
     $value = isset($post['photo_albums']) ? $post['photo_albums'] : $cluster->getParams()->get('photo.albums', $this->params->get('default'));
     $value = (bool) $value;
     $registry = $cluster->getParams();
     $registry->set('photo.albums', $value);
     $cluster->params = $registry->toString();
     unset($post['photo_albums']);
 }
Ejemplo n.º 6
0
 /**
  * Executes before the event is saved.
  *
  * @author  Jason Rey <*****@*****.**>
  * @since   1.3
  * @access  public
  * @param   array           $post       The posted data.
  * @param   SocialCluster   $cluster    The cluster object.
  */
 public function onEditBeforeSave(&$post, &$cluster)
 {
     // Get the posted value
     $value = isset($post[$this->inputName]) ? $post[$this->inputName] : $params->get('discussions', $this->params->get('default'));
     $value = (bool) $value;
     $registry = $cluster->getParams();
     $registry->set('discussions', $value);
     $cluster->params = $registry->toString();
     unset($post[$this->inputName]);
 }