⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 taxonomymonitor.module.svn-base

📁 This is source of book about sites development in Drupal CMS.
💻 SVN-BASE
字号:
<?php// $Id$/** * Implementation of hook_taxonomy(). * * Sends email when changes to vocabularies or terms occur. */function taxonomymonitor_taxonomy($op, $type, $array = array()) {  $to = 'me@example.com';  $name = check_plain($array['name']);    // $type is either 'vocabulary' or 'term'.  switch ($type) {    case 'vocabulary':      switch($op) {        case 'insert':          $subject = t('Vocabulary @voc was added.', array('@voc' => $name));          break;        case 'update':          $subject = t('Vocabulary @voc was changed.', array('@voc' => $name));          break;        case 'delete':          $subject = t('Vocabulary @voc was deleted.', array('@voc' => $name));          break;      }      break;    case 'term':      switch($op) {        case 'insert':          $subject = t('Term @term was added.', array('@term' => $name));          break;        case 'update':          $subject = t('Term @term was changed.', array('@term' => $name));          break;        case 'delete':          $subject = t('Term @term was deleted.', array('@term' => $name));          break;      }  }  // Dump the vocabulary or term information out and send it along.  $body = print_r($array, TRUE);  // Send the email.  drupal_mail('taxonomymonitor-notify', $to, $subject, $body);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -