You are here

function _votingapi_create_set_code in Voting API 5

1 call to _votingapi_create_set_code()
votingapi_actions_admin_export_page in ./votingapi_actions_ui.inc

File

./votingapi_actions_ui.inc, line 226

Code

function _votingapi_create_set_code($set_name) {
  $data = cache_get('votingapi_action_sets');
  $action_sets = unserialize($data->data);
  $set = $action_sets[$set_name];
  if ($set) {
    unset($set['name']);
    $code = "\n\$sets = array(\n";
    $code .= "'{$set_name}' => ";
    ob_start();
    var_export($set);
    $code .= ob_get_clean();
    ob_end_clean();
    $code .= "\n);\n";
  }
  return $code;
}