You are here

class BoxCustom in Boxes 7.2

DO NOT USE THIS BOX. ONLY USED FOR THE UI PLUGINS

Hierarchy

Expanded class hierarchy of BoxCustom

1 string reference to 'BoxCustom'
_boxes_admin_default_plugin in boxes_admin_ui/boxes_admin_ui.module
The Default plugin settings

File

boxes_admin_ui/plugins/custom.inc, line 11
Box ctools plugin

View source
class BoxCustom extends BoxPlugin {

  /**
   * Delete the record from the database.
   */
  public function delete() {

    // Delete all boxes belonging to this box type if we are removing
    // the actual box.
    if ($this
      ->getExportStatus() == 'Normal') {
      db_delete('box')
        ->condition('type', $this->type)
        ->execute();
    }
    db_delete('box_type')
      ->condition('name', $this->type)
      ->execute();
    field_attach_delete_bundle('box', $this->type);
    drupal_flush_all_caches();
  }

  /**
   * Save the record to the database
   */
  public function save($new = FALSE) {
    $box_type = array(
      'name' => $this->type,
      'label' => $this
        ->getLabel(),
      'description' => $this
        ->getDescription(),
    );
    $primary_key = $new == FALSE ? 'name' : array();
    drupal_write_record('box_type', $box_type, $primary_key);
    drupal_static_reset('boxes_admin_ui_get_types');
    boxes_reset();
  }

  /**
   * Get the export status
   */
  public function getExportStatus() {
    return $this->plugin_info['export_status'];
  }

  /**
   * Set the label.
   *
   * @param label
   */
  public function setLabel($label) {
    $this->plugin_info['label'] = $label;
  }

  /**
   * Set the description.
   *
   * @param description
   */
  public function setDescription($description) {
    $this->plugin_info['description'] = $description;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BoxCustom::delete public function Delete the record from the database.
BoxCustom::getExportStatus public function Get the export status
BoxCustom::save public function Save the record to the database
BoxCustom::setDescription public function Set the description.
BoxCustom::setLabel public function Set the label.
BoxPlugin::$plugin_info protected property
BoxPlugin::$type public property
BoxPlugin::buildURL public function Build the URL string Overrides BoxTypePluginInterface::buildURL
BoxPlugin::form public function The Plugin Form Overrides BoxTypePluginInterface::form 1
BoxPlugin::getDescription public function Get the description Overrides BoxTypePluginInterface::getDescription
BoxPlugin::getInfo public function Get Plugin info Overrides BoxTypePluginInterface::getInfo
BoxPlugin::getLabel public function Get the label Overrides BoxTypePluginInterface::getLabel
BoxPlugin::isEditable public function Is the box type editable Overrides BoxTypePluginInterface::isEditable
BoxPlugin::setBox public function Add a Box to the plugin Overrides BoxTypePluginInterface::setBox
BoxPlugin::submit public function React to the saving of the box Overrides BoxTypePluginInterface::submit
BoxPlugin::validate public function The plugin validation function Overrides BoxTypePluginInterface::validate
BoxPlugin::values public function Define the form values and their defaults Overrides BoxTypePluginInterface::values 1
BoxPlugin::view public function Return the block content. Overrides BoxTypePluginInterface::view
BoxPlugin::__construct public function Constructor Overrides BoxTypePluginInterface::__construct