-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:( #13
base: master
Are you sure you want to change the base?
:( #13
Changes from all commits
8c2fe9e
50a2c9a
dc26b91
fd6204b
de669ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name = Node Listing | ||
description = List all the nodes of a node type | ||
dependencies[] = entity | ||
package = Emergya | ||
core = 7.x |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
/** | ||
* Implements form alter(). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implements hook_form_FORM_ID_alter(). |
||
*/ | ||
|
||
function node_train_list_form_node_type_form_alter(&$form, &$form_state, $form_id) { | ||
|
||
$form['listing']=array( | ||
'#type' => 'fieldset', | ||
'#title' => 'Node type listing', | ||
'#group' => 'additional_settings' | ||
); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1 espacio solo |
||
|
||
$form['listing']['checkbox']=array( | ||
'#type' => 'checkbox', | ||
'#title' => t('Añadir nodos a un listado de este tipo de contenido'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. t('Always in English , please'), |
||
'#default_value' => variable_get('node_train_list_form_node_type_form_submit', 0), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No quiero que me guardes un solo valor, deberia guardar un array con los tipos de contenido que tengan marcado. Por ejemplo:
|
||
); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comentario porfi! |
||
$form['#submit'][] = 'node_train_list_form_node_type_form_submit'; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quitame enters al final! porfi |
||
|
||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comentario porfi |
||
function node_train_list_form_node_type_form_submit($form, &$form_state) { | ||
variable_set('node_train_list_form_node_type_form_submit', $form_state['values']['checkbox']); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. // Me traigo la variable variable_set('jdksjdksjdkjkds', $settings); |
||
} | ||
/** | ||
* Implements hook_menu() | ||
*/ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. juntico please |
||
function node_train_list_menu() { | ||
$items = array ( | ||
'node-type-form' => array ( | ||
'page callback' => 'node_train_list_callback', | ||
'page arguments' => array('node_train_list_node_type_form'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No te hace falta. |
||
'access callback' => 'user_access', | ||
'access arguments' => array('access to node listing'), | ||
|
||
), | ||
); | ||
return $items; | ||
} | ||
|
||
/** | ||
* Implements hook permission | ||
*/ | ||
|
||
function node_train_list_permission() { | ||
return array( | ||
'access to node listing' => array( | ||
'title' => t('Administer Node Listing'), | ||
'description' => t('Administer the permission to Node Train List'), | ||
), | ||
); | ||
} | ||
|
||
/** | ||
* Define my callback | ||
*/ | ||
|
||
function node_train_list_callback($variables) { | ||
$header = array('Cell 1', 'Cell 2'); | ||
$rows = array( | ||
array('A', 'B'), | ||
array('C', 'D') | ||
); | ||
$output = theme('table', | ||
array('header' => $header, | ||
'rows' => $rows )); | ||
return $output; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ file