Skip to content

Instantly share code, notes, and snippets.

@hiromi2424
Created July 10, 2010 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiromi2424/470538 to your computer and use it in GitHub Desktop.
Save hiromi2424/470538 to your computer and use it in GitHub Desktop.
<?php
if (!empty($this->params['path'])) {
$path = $this->params['path'];
$type = array_shift($path);
$types = array('origin', 'incomplete', 'review');
$types = array_diff($types, array($type));
$moveTo = '<h4>' . __('Move to', true) . '</h4>';
$copyTo = '<h4>' . __('Copy to', true) . '</h4>';
$this->Menu->add('actions', $moveTo, false, null, array('escapeTitle' => false));
$this->Menu->add('actions', $copyTo, false, null, array('escapeTitle' => false));
foreach ($types as $type) {
$link = array_merge(array($type), $path);
$this->Menu->add('actions', Inflector::humanize($type), $link, $moveTo);
$this->Menu->add('actions', Inflector::humanize($type), $link, $copyTo);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment