<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blogbonzo: Matteo Magni &#187; drupal</title>
	<atom:link href="http://blog.ilbonzo.org/category/cms/drupal/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ilbonzo.org</link>
	<description>Consulente Informatico, Web Developer &#38; System Administrator</description>
	<lastBuildDate>Wed, 09 Dec 2009 13:07:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Drupal best open source PHP CMS 2009</title>
		<link>http://blog.ilbonzo.org/2009/11/12/drupal-best-open-source-php-cms-2009/</link>
		<comments>http://blog.ilbonzo.org/2009/11/12/drupal-best-open-source-php-cms-2009/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 08:54:02 +0000</pubDate>
		<dc:creator>Bonzo</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Senza categoria]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.ilbonzo.org/?p=368</guid>
		<description><![CDATA[Drupal riVince l&#8217;Open Source CMS Award 2009 nella categoria Best Open Source PHP CMS rilasciato sotto licenza GNU/GPL o equivalente.
Secondi a parimerito Joomla e Worpress.
Tra i milgiori CMS non in PHP invece vince Plone.
]]></description>
			<content:encoded><![CDATA[<p>Drupal <a href="http://www.packtpub.com/nominate-best-open-source-php-cms">riVince</a> l&#8217;Open Source CMS Award 2009 nella categoria Best Open Source PHP CMS rilasciato sotto licenza GNU/GPL o equivalente.<br />
Secondi a parimerito Joomla e Worpress.<br />
Tra i milgiori CMS non in PHP invece vince Plone.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ilbonzo.org/2009/11/12/drupal-best-open-source-php-cms-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>La casa Bianca usa Drupal</title>
		<link>http://blog.ilbonzo.org/2009/10/26/la-casa-bianca-usa-drupal/</link>
		<comments>http://blog.ilbonzo.org/2009/10/26/la-casa-bianca-usa-drupal/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 22:17:00 +0000</pubDate>
		<dc:creator>Bonzo</dc:creator>
				<category><![CDATA[Pubblica Amministrazione]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://blog.ilbonzo.org/?p=363</guid>
		<description><![CDATA[La Casa Bianca modifica il proprio sito appoggiandolo su Drupal. Esteriormente il sito non è cambiato, ma alle spalle ora c&#8217;è il mio CMS preferito.
Complimenti a loro.
via Ossblog 
]]></description>
			<content:encoded><![CDATA[<p>La Casa Bianca modifica il proprio sito appoggiandolo su Drupal. Esteriormente il sito non è cambiato, ma alle spalle ora c&#8217;è il mio CMS preferito.<br />
Complimenti a loro.</p>
<p><a href="http://www.ossblog.it/post/5290/la-casa-bianca-passa-a-drupal-e-apre-il-codice-al-pubblico">via Ossblog </a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ilbonzo.org/2009/10/26/la-casa-bianca-usa-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modulo Drupal per nuovo tipo di contenuto</title>
		<link>http://blog.ilbonzo.org/2009/06/25/modulo-drupal-per-nuovo-tipo-di-contenuto/</link>
		<comments>http://blog.ilbonzo.org/2009/06/25/modulo-drupal-per-nuovo-tipo-di-contenuto/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 08:02:13 +0000</pubDate>
		<dc:creator>Bonzo</dc:creator>
				<category><![CDATA[drupal]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.ilbonzo.org/?p=284</guid>
		<description><![CDATA[In Drupal è molto semplice sviluppare un modulo che permeta di avere a disposizione un nuovo tipo di contenuto che estenda il classico nodo.
Vediamo come sviluppare un modulo che aggiunga il tipo di contenuto libro.
Creiamo la cartella node_book che andremo a mettere nella cartella modules del nostro sito.
Dentro questa cartella mettiamo il file node_book.info con [...]]]></description>
			<content:encoded><![CDATA[<p>In Drupal è molto semplice sviluppare un modulo che permeta di avere a disposizione un nuovo tipo di contenuto che estenda il classico nodo.</p>
<p>Vediamo come sviluppare un modulo che aggiunga il tipo di contenuto libro.</p>
<p>Creiamo la cartella node_book che andremo a mettere nella cartella modules del nostro sito.<br />
Dentro questa cartella mettiamo il file <em>node_book.info</em> con le specifiche del nodo:<br />
<code><br />
; $Id$<br />
name = node book<br />
description = "nodo libro"<br />
core = 6.x<br />
</code></p>
<p>e il file node_book.module con il codice vero e proprio.</p>
<p>Ecco i vari hook che si devono implementare:<br />
<strong>Hook menu</strong><br />
<code><br />
function node_book_menu()<br />
{<br />
	$items[] = array( 'path' => 'node_book', 'callback' => 'node_book_page', 'access' => true, 'type' => MENU_CALLBACK );<br />
      return $items;<br />
}<br />
</code></p>
<p><strong>hook perm</strong><br />
<code><br />
function node_book_perm()<br />
{<br />
  return array('create book node', 'edit own book nodes');<br />
}<br />
</code><br />
<strong>hook access</strong><br />
<code>function node_book_access($op, $node, $account) {<br />
  if ($op == 'create') {<br />
    // Only users with permission to do so may create this node type.<br />
    return user_access('create nameofnodetype', $account);<br />
  }<br />
  // Users who create a node may edit or delete it later, assuming they have the<br />
  // necessary permissions.<br />
  if ($op == 'update' || $op == 'delete') {<br />
    if (user_access('edit own nameofnodetype', $account) &#038;&#038; ($account->uid == $node->uid)) {<br />
      return TRUE;<br />
    }<br />
  }<br />
}</code></p>
<p><strong>hook help</strong><br />
<code>function node_book_help($path, $arg) {<br />
  switch ($path) {<br />
    case 'admin/help#block':<br />
      return '
<p>'. t('Blocks are boxes of content that may be rendered into certain regions of your web pages, for example, into sidebars. Blocks are usually generated automatically by modules (e.g., Recent Forum Topics), but administrators can also define custom blocks.') .'</p>
<p>';</p>
<p>    case 'admin/build/block':<br />
      return t('
<p>Blocks are boxes of content that may be rendered into certain regions of your web pages, for example, into sidebars. They are usually generated automatically by modules, but administrators can create blocks manually.</p>
<p>If you want certain blocks to disable themselves temporarily during high server loads, check the "Throttle" box. You can configure the auto-throttle on the <a href="@throttle">throttle configuration page</a> after having enabled the throttle module.</p>
<p>You can configure the behaviour of each block (for example, specifying on which pages and for what users it will appear) by clicking the "configure" link for each block.</p>
<p>', array('@throttle' => url('admin/settings/throttle')));<br />
  }<br />
}</code><br />
Ora passiamo agli hook che implementano veramente il nostro modulo:<br />
<strong>hook form</strong><br />
<code><br />
function node_book_form(&#038;$node) {<br />
$type = node_get_types('type', $node);<br />
  if ($type->has_title) {<br />
    $form['title'] = array(<br />
      '#type' => 'textfield',<br />
      '#title' => check_plain($type->title_label),<br />
      '#required' => TRUE,<br />
      '#default_value' => $node->title,<br />
      '#weight' => -5<br />
    );<br />
  }<br />
  if ($type->has_body) {<br />
    // In Drupal 6, we can use node_body_field() to get the body and filter<br />
    // elements. This replaces the old textarea + filter_form() method of<br />
    // setting this up. It will also ensure the teaser splitter gets set up<br />
    // properly.<br />
    $form['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count);<br />
  }<br />
  // NOTE in node_example there is some addition code here not needed for this simple node-type<br />
 // Now we define the form elements specific to our node type.<br />
  $form['editor'] = array(<br />
    '#type' => 'textfield',<br />
    '#title' => t('Editore'),<br />
    '#default_value' => isset($node->editor) ? $node->editor : '',<br />
  );<br />
  $form['book_author'] = array(<br />
    '#type' => 'textfield',<br />
    '#title' => t('Autore'),<br />
    '#default_value' => isset($node->book_author) ? $node->book_author : '',<br />
  );<br />
  $form['place'] = array(<br />
    '#type' => 'textfield',<br />
    '#title' => t('Luogo'),<br />
    '#default_value' => isset($node->place) ? $node->place : '',<br />
  );<br />
  $form['year'] = array(<br />
    '#type' => 'textfield',<br />
    '#title' => t('Anno'),<br />
    '#default_value' => isset($node->year) ? $node->year : '',<br />
  );<br />
  $form['book_type'] = array(<br />
    '#type' => 'textfield',<br />
    '#title' => t('Tipo'),<br />
    '#default_value' => isset($node->book_type) ? $node->book_type : '',<br />
  );<br />
  $form['magazine'] = array(<br />
    '#type' => 'textfield',<br />
    '#title' => t('Rivista'),<br />
    '#default_value' => isset($node->magazine) ? $node->magazine : '',<br />
  );<br />
  return $form;<br />
}</code></p>
<p><strong>hook insert</strong><br />
/**<br />
 * Implementation of hook_insert().<br />
 *<br />
 * As a new node is being inserted into the database, we need to do our own<br />
 * database inserts.<br />
 */<br />
<code>function node_book_insert($node) {<br />
  db_query("INSERT INTO {node_book} (vid, nid, editor, book_author, place, year, book_type, magazine) VALUES (%d, %d, '%s', '%s', '%s', '%s', '%s', '%s')", $node->vid, $node->nid,$node->editor,$node->book_author,$node->place,$node->year,$node->book_type,$node->magazine);<br />
}</code></p>
<p><strong>hook update</strong><br />
<code>/**<br />
 * Implementation of hook_update().<br />
 *<br />
 * As an existing node is being updated in the database, we need to do our own<br />
 * database updates.<br />
 */<br />
function node_book_update($node) {<br />
  // if this is a new node or we're adding a new revision,<br />
  if ($node->revision) {<br />
    node_book_insert($node);<br />
  }<br />
  else {<br />
    db_query("UPDATE {node_book} SET editor='%s', book_author='%s', place='%s', year='%s', book_type='%s', magazine='%s' WHERE vid = %d",  $node->editor, $node->book_author, $node->place, $node->year, $node->book_type, $node->magazine, $node->vid);<br />
  }<br />
}<br />
</code></p>
<p><strong>hook nodeapi</strong><br />
<code>/**<br />
 * Implementation of hook_nodeapi().<br />
 *<br />
 * When a node revision is deleted, we need to remove the corresponding record<br />
 * from our table. The only way to handle revision deletion is by implementing<br />
 * hook_nodeapi().<br />
 */<br />
function node_book_nodeapi(&#038;$node, $op, $teaser, $page) {<br />
  switch ($op) {<br />
    case 'delete revision':<br />
      // Notice that we're matching a single revision based on the node's vid.<br />
      db_query('DELETE FROM {node_book} WHERE vid = %d', $node->vid);<br />
      break;<br />
  }<br />
}</code></p>
<p><strong>hook_delete</strong><br />
/**<br />
 * Implementation of hook_delete().<br />
 *<br />
 * When a node is deleted, we need to remove all related records from out table.<br />
 */<br />
function node_book_delete($node) {<br />
  // Notice that we&#8217;re matching all revision, by using the node&#8217;s nid.<br />
  db_query(&#8217;DELETE FROM {node_book} WHERE nid = %d&#8217;, $node->nid);<br />
}</p>
<p><strong>hook load</strong><br />
<code>/**<br />
 * Implementation of hook_load().<br />
 *<br />
 * Now that we've defined how to manage the node data in the database, we<br />
 * need to tell Drupal how to get the node back out. This hook is called<br />
 * every time a node is loaded, and allows us to do some loading of our own.<br />
 */<br />
function node_book_load($node) {<br />
  $additions = db_fetch_object(db_query('SELECT editor,book_author,place,year,book_type,magazine FROM {node_book} WHERE vid = %d', $node->vid));<br />
  return $additions;<br />
}<br />
</code></p>
<p><strong>hook view</strong><br />
<code>/**<br />
 * Implementation of hook_view().<br />
 *<br />
 * This is a typical implementation that simply runs the node text through<br />
 * the output filters.<br />
 */<br />
function node_book_view($node, $teaser = FALSE, $page = FALSE) {<br />
    $node = node_prepare($node, $page);<br />
    $node->content['myfield'] = array(<br />
	'#value' => 'Editore: '.$node->editor.'&lt;br /&gt;'.'Autore: '.$node->book_author.'&lt;br &gt;'.'Luogo: '.$node->place.'&lt;br &gt;'.'Anno: '.$node->year.'&lt;br &gt;'.'Tipologia: '.$node->book_type.'&lt;br &gt;',<br />
    	'#weight' => 1,<br />
  );<br />
  return $node;<br />
}<br />
</code></p>
<p>Ora manca solo il DB, ecco la tabella per i campi in più del nostro nodo<br />
CREATE TABLE node_book (<br />
vid int(10) unsigned NOT NULL default &#8216;0&#8242;,<br />
nid int(10) unsigned NOT NULL default &#8216;0&#8242;,<br />
editor varchar(255) NOT NULL default &#8221;,<br />
book_author varchar(255) NOT NULL default &#8221;,<br />
place varchar(255),<br />
year varchar(255),<br />
book_type varchar(255),<br />
magazine varchar(255),<br />
PRIMARY KEY (vid, nid),<br />
KEY `node_type_book_nid` (nid)<br />
)</p>
<p>Dopo aver creato la tabella e attivato il modulo avrete un nuovo tipo di contenuto disponibile.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ilbonzo.org/2009/06/25/modulo-drupal-per-nuovo-tipo-di-contenuto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scrivere Modulo Drupal</title>
		<link>http://blog.ilbonzo.org/2009/06/01/scrivere-modulo-drupal/</link>
		<comments>http://blog.ilbonzo.org/2009/06/01/scrivere-modulo-drupal/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 15:28:31 +0000</pubDate>
		<dc:creator>Bonzo</dc:creator>
				<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://blog.ilbonzo.org/?p=264</guid>
		<description><![CDATA[Ultimamente mi sono concentrato molto su Drupal, soprattutto per la sua flessibilità e modularità.
La possibilità di scrivere un modulo, che aggiunge funzioni, senza andare a toccare il core  del resto del cms è veramente molto utile e produttivo.
Ecco un esempio di primo modulo che chiameremo nodelist:
Creiamo un file nodelist.info che contiene le informazioni del [...]]]></description>
			<content:encoded><![CDATA[<p>Ultimamente mi sono concentrato molto su <a href="http://drupal.org">Drupal</a>, soprattutto per la sua flessibilità e modularità.<br />
La possibilità di scrivere un modulo, che aggiunge funzioni, senza andare a toccare il core  del resto del cms è veramente molto utile e produttivo.</p>
<p>Ecco un esempio di primo modulo che chiameremo <code>nodelist</code>:<br />
Creiamo un file <strong>nodelist.info</strong> che contiene le informazioni del modulo.</p>
<p><code>; $Id: nodelist.info Exp $<br />
name = Nodelist<br />
description = visualizza list nodi<br />
package = node<br />
version = VERSION<br />
core = 6.x</code></p>
<p><code>; Information added by drupal.org packaging script on 2008-08-14<br />
version = "6.4"<br />
project = "drupal"</code></p>
<p>Creare il file <strong>nodelist.module</strong> in cui scriveremo il modulo vero e proprio.</p>
<p>Per fare ciò utilizziamo i famosi <a href="http://api.drupal.org/api/group/hooks">Hook</a> di Drupal.<br />
Le varie function per convenzione si chiameranno nodelist_[hook].</p>
<p><code><br />
/**<br />
* Display help and module information<br />
* @param path which path of the site we're displaying help<br />
* @param arg array that holds the current path as would be returned from arg() function<br />
* @return help text for the path<br />
*/<br />
function nodelist_help($path, $arg) {<br />
  $output = '';<br />
  switch ($path) {<br />
    case "admin/help#nodelist":<br />
      $output = '&lt;p&gt;'.t("Displays links to nodes ") .'&lt;/p&gt;';<br />
      break;<br />
  }<br />
  return $output;<br />
}<br />
/**<br />
* Valid permissions for this module<br />
* @return array An array of valid permissions for the mailing module<br />
*/<br />
function nodelist_perm() {<br />
  return array('access nodelist content');<br />
} // function nodelist_perm()<br />
/**<br />
*<br />
* @return<br />
*/<br />
function nodelist_block($op='list', $delta=0) {<br />
  // listing of blocks, such as on the admin/block page<br />
  if ($op == "list") {<br />
    $block[0]["info"] = t("node List");<br />
    return $block;<br />
  } else if ($op == 'view') {<br />
  // our block content<br />
    // content variable that will be returned for display<br />
    $block_content = '';<br />
    $result =  db_query("SELECT nid, title, created FROM {node} ");<br />
    while ($links = db_fetch_object($result)) {<br />
      $block_content .= l($links->title, 'node/'.$links->nid) . '<br />';<br />
    }<br />
    // check to see if there was any content before setting up the block<br />
    if ($block_content == '') {<br />
      // no content from a week ago, return nothing.<br />
      return;<br />
    }<br />
    // set up the block<br />
    $block['subject'] = 'node';<br />
    $block['content'] = $block_content;<br />
    return $block;<br />
  }<br />
}<br />
</code></p>
<p>Con questi file dentro la cartella nodelist e caricata nella cartella modules vi troverete la possibilità di abilitare il nuovo modulo.<br />
Abilitandolo avrete il nuovo blocco a disposizione.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ilbonzo.org/2009/06/01/scrivere-modulo-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP day 2008</title>
		<link>http://blog.ilbonzo.org/2008/05/31/php-day-2008/</link>
		<comments>http://blog.ilbonzo.org/2008/05/31/php-day-2008/#comments</comments>
		<pubDate>Sat, 31 May 2008 05:44:31 +0000</pubDate>
		<dc:creator>Bonzo</dc:creator>
				<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[eventi]]></category>

		<guid isPermaLink="false">http://blog.ilbonzo.org/2008/05/31/php-day-2008/</guid>
		<description><![CDATA[Venerdì scorso ho partecipato al primo giorno del PHP day 2008.
Rispetto allo scorso anno l&#8217;evento è risultato molto più interessante, forse anche per una mia maggior predisposizione allo scambio di opinioni e battute con i partecipanti. Purtroppo non ho potuto partecipare ai workshop del sabato, speriamo nel prossimo anno.
Ecco il talk che ho apprezzato di [...]]]></description>
			<content:encoded><![CDATA[<p>Venerdì scorso ho partecipato al primo giorno del <a href="http://www.phpday.it/site/">PHP day 2008</a>.<br />
Rispetto allo scorso anno l&#8217;evento è risultato molto più interessante, forse anche per una mia maggior predisposizione allo scambio di opinioni e battute con i partecipanti. Purtroppo non ho potuto partecipare ai workshop del sabato, speriamo nel prossimo anno.</p>
<p>Ecco il talk che ho apprezzato di più:<br />
Nel canale Enterprise si è assistito a un piccolo confronto tra tre CMS tra i più diffusi.</p>
<ul>
<li><a href="http://joomla.org">Joomla</a></li>
<li><a href="http://drupal.org">Drupal</a></li>
<li><a href="http://ez.no">eZpublish</a></li>
</ul>
<p>Avendoli utilizzati tutti e tre, ho apprezzato e seguito con interesse il confronto e la mia piccola conclusione è che Drupal è il miglior compromesso tra potenza e semplicità (ovviamente grazie a views e cck), eZpublish è potentissimo ma adatto a grosse realtà (con le sue 102 tabelle e tutto il resto è forse troppo esoso di risorse per un semplice blog), mentre Joomla rimane un po&#8217; staccato avendo una flessibilità minore rispetto agli altri due, nonostante ciò è quello con un community maggiore, quindi è sempre da tenere d&#8217;occhio. </p>
<p><a rel="shadowbox" href="http://farm3.static.flickr.com/2380/2531637547_c6d74e9f55.jpg?v=0"><img src="http://farm3.static.flickr.com/2380/2531637547_c6d74e9f55.jpg?v=0" alt="I pochi rimasti per i talk finali del venerdì" /></a></p>
<p>Oltre a questo ho fatto in tempo a sentire il talk di Daniele Teti sui Design patterns e quello di <a href="http://www.simonecarletti.com/blog/">Simone Carletti</a> sullo <a href="http://framework.zend.com/">zend framework</a> ed i web services. Quest&#8217;ultimo è stato ricco di esempi e molto interessante, non a caso ho scaricato lo Zend il giorno dopo e penso che, almeno come libreria comicerò ad usarlo. Uno dei suoi vantaggi è proprio il fatto di poter essere usato a pezzi, non costringendo il programmatore a sapere tutto sul framework. </p>
<p>Dal Blog di Fullo un po&#8217; di Link su foto, video e altro dell&#8217;evento.<br />
<a href="http://www.fullo.net/blog/archives/2008/05/29/phpday-2008-un-bellevento-a-meta/">Fullo Blog</a></p>
<p>Ci si vede nel 2009</p>
<p>Gabba Gabba Hey<br />
Bonzo</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ilbonzo.org/2008/05/31/php-day-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
