You are here

function ccl_get_presets in Custom Contextual Links 8

Same name and namespace in other branches
  1. 7 ccl.module \ccl_get_presets()

Retrieve a link based on it's title.

4 calls to ccl_get_presets()
ccl_features_export in ./ccl.features.inc
Implements hook_features_export().
ccl_features_export_options in ./ccl.features.inc
Implements hook_features_export_options().
ccl_features_export_render in ./ccl.features.inc
Implements hook_features_export_render().
ccl_features_rebuild in ./ccl.features.inc
Implements hook_features_rebuild().

File

./ccl.module, line 83
Main CCL module file.

Code

function ccl_get_presets($key = NULL) {
  $presets = array();
  if ($key) {
    $key_parts = explode('||ID', $key);
    $results = db_query('SELECT * FROM {ccl} WHERE clid = :clid AND title = :title', array(
      ':clid' => $key_parts[1],
      ':title' => $key_parts[0],
    ));
  }
  else {
    $results = db_query('SELECT * FROM {ccl}');
  }
  while ($result = $results
    ->fetchObject()) {
    $presets[] = $result;
  }
  return $presets;
}