You are here

function ctools_export_crud_set_status in Chaos Tool Suite (ctools) 7

Change the status of a certain object.

Parameters

$table: The name of the table to use to enable a certain object. This table must have an 'export' section containing data or this function will fail.

$object: The fully populated object to enable, or the machine readable name.

$status: The status, in this case, is whether or not it is 'disabled'.

Related topics

3 calls to ctools_export_crud_set_status()
ctools_export_crud_disable in includes/export.inc
Disable a certain object.
ctools_export_crud_enable in includes/export.inc
Enable a certain object.
ctools_export_ui::set_item_state in plugins/export_ui/ctools_export_ui.class.php
Set an item's state to enabled or disabled and output to user.

File

includes/export.inc, line 314
Contains code to make it easier to have exportable objects.

Code

function ctools_export_crud_set_status($table, $object, $status) {
  $schema = ctools_export_get_schema($table);
  $export = $schema['export'];
  if (!empty($export['status callback']) && function_exists($export['status callback'])) {
    $export['status callback']($object, $status);
  }
  else {
    if (is_object($object)) {
      ctools_export_set_object_status($object, $status);
    }
    else {
      ctools_export_set_status($table, $object, $status);
    }
  }
}