You are here

function block_class_menu in Block Class 5

File

./block_class.module, line 3

Code

function block_class_menu($may_cache) {
  if (!$may_cache && strpos($_GET['q'], 'admin/build/block/configure/') === 0 && isset($_POST['css_class']) && user_access('administer blocks')) {
    $module = arg(4);
    $delta = arg(5);
    $class = $_POST['css_class'];
    db_query('DELETE FROM {block_class} WHERE module = "%s" AND delta = "%s"', $module, $delta);
    if (!empty($class)) {
      db_query('INSERT INTO {block_class} (module, delta, css_class) VALUES ("%s", "%s", "%s")', $module, $delta, $class);
    }
  }
}