| 159 | | |
| 160 | | /* |
| 161 | | if (arg(0) == 'jsdoc' && arg(3)) { |
| 162 | | // jsdoc/namespace/'HEAD'/resource/object |
| 163 | | if (arg(4) && arg(4) != 'view' && arg(4) != 'edit' && arg(4) != 'private') { |
| 164 | | $item = arg(3) . '/' . arg(4); |
| 165 | | $object = $node = jsdoc_object_node_load(arg(4), arg(1), arg(2), str_replace('__', '/', arg(3))); |
| 166 | | } |
| 167 | | // jsdoc/namespace/'HEAD'/object |
| 168 | | else { |
| 169 | | $item = arg(3); |
| 170 | | $object = $node = jsdoc_object_node_load(arg(3), arg(1), arg(2)); |
| 171 | | } |
| 172 | | |
| 173 | | if (jsdoc_get_variable_object($node)) { |
| 174 | | $object = jsdoc_get_variable_object($node); |
| 175 | | } |
| 176 | | $items[] = array('path' => 'jsdoc/' . arg(1) . '/' . arg(2) . '/' . $item, |
| 177 | | 'title' => t('View'), |
| 178 | | 'callback' => 'jsdoc_object_node_view', |
| 179 | | 'callback arguments' => array($node), |
| 180 | | 'access' => node_access('view', $node), |
| 181 | | 'type' => MENU_CALLBACK |
| 182 | | ); |
| 183 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/view', |
| 184 | | 'title' => t('View'), |
| 185 | | 'type' => MENU_DEFAULT_LOCAL_TASK, |
| 186 | | 'weight' => -10 |
| 187 | | ); |
| 188 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/private', |
| 189 | | 'title' => t('View w/ Private'), |
| 190 | | 'callback' => 'jsdoc_object_node_view', |
| 191 | | 'callback arguments' => array($node, null, true), |
| 192 | | 'access' => node_access('view', $node), |
| 193 | | 'weight' => -9, |
| 194 | | 'type' => MENU_LOCAL_TASK |
| 195 | | ); |
| 196 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/edit', |
| 197 | | 'title' => t('Edit'), |
| 198 | | 'callback' => 'jsdoc_object_edit_redirect', |
| 199 | | 'callback arguments' => array($node), |
| 200 | | 'access' => node_access('update', $node), |
| 201 | | 'weight' => 1, |
| 202 | | 'type' => MENU_LOCAL_TASK |
| 203 | | ); |
| 204 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/edit/' . arg(6), |
| 205 | | 'title' => t('Edit'), |
| 206 | | 'callback' => 'jsdoc_object_edit_redirect', |
| 207 | | 'callback arguments' => array($node, arg(6)), |
| 208 | | 'access' => node_access('update', $node), |
| 209 | | 'weight' => 1, |
| 210 | | 'type' => MENU_LOCAL_TASK |
| 211 | | ); |
| 212 | | |
| 213 | | if (jsdoc_get_type($object) == 'Function') { |
| 214 | | if (jsdoc_get_classlike($object) || jsdoc_is_initialized($object)) { |
| 215 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/view/init', |
| 216 | | 'title' => t('Initialized'), |
| 217 | | 'type' => MENU_DEFAULT_LOCAL_TASK, |
| 218 | | 'weight' => -10 |
| 219 | | ); |
| 220 | | if (!jsdoc_is_initialized($object)) { |
| 221 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/view/normal', |
| 222 | | 'title' => t('Uninitialized'), |
| 223 | | 'callback' => 'jsdoc_object_node_view', |
| 224 | | 'callback arguments' => array($node, false), |
| 225 | | 'access' => node_access('view', $node), |
| 226 | | 'type' => MENU_LOCAL_TASK |
| 227 | | ); |
| 228 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/private/init', |
| 229 | | 'title' => t('Initialized'), |
| 230 | | 'type' => MENU_DEFAULT_LOCAL_TASK, |
| 231 | | 'weight' => -10 |
| 232 | | ); |
| 233 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/private/normal', |
| 234 | | 'title' => t('Uninitialized'), |
| 235 | | 'callback' => 'jsdoc_object_node_view', |
| 236 | | 'callback arguments' => array($node, false, true), |
| 237 | | 'access' => node_access('view', $node), |
| 238 | | 'type' => MENU_LOCAL_TASK |
| 239 | | ); |
| 240 | | } |
| 241 | | } |
| 242 | | else { |
| 243 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/view/normal', |
| 244 | | 'title' => t('Uninitialized'), |
| 245 | | 'type' => MENU_DEFAULT_LOCAL_TASK, |
| 246 | | 'weight' => -10 |
| 247 | | ); |
| 248 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/view/init', |
| 249 | | 'title' => t('Initialized'), |
| 250 | | 'callback' => 'jsdoc_object_node_view', |
| 251 | | 'callback arguments' => array($node, true), |
| 252 | | 'access' => node_access('view', $node), |
| 253 | | 'type' => MENU_LOCAL_TASK |
| 254 | | ); |
| 255 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/private/normal', |
| 256 | | 'title' => t('Uninitialized'), |
| 257 | | 'type' => MENU_DEFAULT_LOCAL_TASK, |
| 258 | | 'weight' => -10 |
| 259 | | ); |
| 260 | | $items[] = array('path' => 'jsdoc/'. arg(1) . '/' . arg(2) . '/' . $item . '/private/init', |
| 261 | | 'title' => t('Initialized'), |
| 262 | | 'callback' => 'jsdoc_object_node_view', |
| 263 | | 'callback arguments' => array($node, true, true), |
| 264 | | 'access' => node_access('view', $node), |
| 265 | | 'type' => MENU_LOCAL_TASK |
| 266 | | ); |
| 267 | | } |
| 268 | | } |
| 269 | | } |
| 270 | | */ |