Mailinglist
 All Data Structures Files Functions Variables Pages
Public Member Functions | Data Fields
MailinglistExportable Class Reference

Place for common code for classes used in export_ui classes. More...

Inheritance diagram for MailinglistExportable:
Inheritance graph
[legend]
Collaboration diagram for MailinglistExportable:
Collaboration graph
[legend]

Public Member Functions

 get_setting ($name, $def=NULL)
 get_settings() More...
 
MailinglistPolymorphicExportableInterface
 created ()
 created() More...
 
 edited ($old)
 edited() More...
 
 changedType (MailinglistPolymorpicExportableInterface $old)
 changedType() More...
 
 delete ()
 delete() More...
 
 baseName ()
 baseName() More...
 
ctools_export_ui_interface
 edit_form (&$form, &$form_state)
 Implements ctools_export_ui::edit_form() called via mailinglist_export_ui Build an edit form for our object. More...
 
 edit_form_validate (&$form, &$form_state)
 Implements ctools_export_ui::edit_form_validate(). More...
 
 edit_form_submit (&$form, &$form_state)
 Implements ctools_export_ui::edit_form_submit(). More...
 
MailinglistPolymorphicExportableInterface

Data Fields

 $object_type
 The type of object we are. More...
 
 $settings
 Generic Array to hold misc settings so all can use same schema. More...
 
 $export_type
 Needed by CTools. More...
 

Logging

const LOG_OFF = 0
 
const LOG_SCREEN = 1
 
const LOG_DB = 2
 
const LOG_DB_SCREEN = 3
 
const LOG_FILE = 4
 
const LOG_FILE_SCREEN = 5
 
const LOG_DEBUG = WATCHDOG_DEBUG
 
const LOG_INFO = WATCHDOG_INFO
 
const LOG_NOTICE = WATCHDOG_NOTICE
 
const LOG_WARNING = WATCHDOG_WARNING
 
const LOG_ERROR = WATCHDOG_ERROR
 
const LOG_CRITICAL = WATCHDOG_CRITICAL
 
const LOG_ALERT = WATCHDOG_ALERT
 
const LOG_EMERGENCY = WATCHDOG_EMERGENCY
 
 $logging_screen = self::LOG_DEBUG
 
 $logging_db = self::LOG_INFO
 
 $logging_file = self::LOG_DEBUG
 
 log ($str, $level=self::LOG_NOTICE, $parms=array())
 log() More...
 
 log_screen ($str, $parms=array(), $level=self::LOG_NOTICE)
 log_screen() More...
 
 log_db ($str, $parms=array(), $level=self::LOG_ERROR)
 log_db(). More...
 
 log_file ($str, $parms=array(), $level=self::LOG_INFO)
 log_file(). More...
 

Detailed Description

Place for common code for classes used in export_ui classes.

Main purpose is to make sure all export_ui classes implement the hooks forwarded by the export_ui code

Definition at line 13 of file mailinglist_exportable.class.php.

Member Function Documentation

baseName ( )

baseName()

Returns
string, the base name for hooks, default is the database table name

Definition at line 78 of file mailinglist_exportable.class.php.

Referenced by changedType(), created(), delete(), and edited().

78  {
79  return $this->table;
80  }

Here is the caller graph for this function:

changedType ( MailinglistPolymorpicExportableInterface  $old)

changedType()

hook called when an object has had its object_type changed in the database.

Implements MailinglistPolymorphicExportableInterface.

Definition at line 60 of file mailinglist_exportable.class.php.

References baseName().

60  {
61  $ret = module_invoke_all($this->baseName() . '_changed_type', $this, $old);
62  }

Here is the call graph for this function:

created ( )

created()

hook called when a new object has been created in the database.

Implements MailinglistPolymorphicExportableInterface.

Definition at line 42 of file mailinglist_exportable.class.php.

References baseName().

42  {
43  $ret = module_invoke_all($this->baseName() . '_created', $this);
44  }

Here is the call graph for this function:

delete ( )

delete()

hook called when an object is about to be deleted from the database.

Implements MailinglistPolymorphicExportableInterface.

Definition at line 69 of file mailinglist_exportable.class.php.

References baseName().

69  {
70  $ret = module_invoke_all($this->baseName() . '_delete', $this);
71  }

Here is the call graph for this function:

edit_form ( $form,
$form_state 
)

Implements ctools_export_ui::edit_form() called via mailinglist_export_ui Build an edit form for our object.

Definition at line 95 of file mailinglist_exportable.class.php.

95  {
96  }
edit_form_submit ( $form,
$form_state 
)

Implements ctools_export_ui::edit_form_submit().

called via mailinglist_export_ui

Definition at line 109 of file mailinglist_exportable.class.php.

109  {
110  }
edit_form_validate ( $form,
$form_state 
)

Implements ctools_export_ui::edit_form_validate().

called via mailinglist_export_ui

Definition at line 102 of file mailinglist_exportable.class.php.

102  {
103  }
edited (   $old)

edited()

hook called when an object has been updated in the database.

Implements MailinglistPolymorphicExportableInterface.

Definition at line 51 of file mailinglist_exportable.class.php.

References baseName().

51  {
52  $ret = module_invoke_all($this->baseName() . '_edited', $this, $old);
53  }

Here is the call graph for this function:

get_setting (   $name,
  $def = NULL 
)

get_settings()

Get a settings from the object.

Parameters
$nameThe name of the setting.
$defDefault value to return if setting is not present.

Definition at line 26 of file mailinglist_exportable.class.php.

Referenced by MailinglistPhpImapRetrieve\edit_form(), Mailman21List\edit_form(), MailinglistPop3Retrieve\edit_form(), MailinglistMailboxRetrieve\edit_form(), MailinglistRetrieve\edit_form(), MailinglistList\edit_form(), MailinglistList\genericListMatch(), Mailman21List\getMemberInfo(), Mailman21List\getMemberPage(), and Mailman21List\getWebPage().

26  {
27  if (isset($this->settings[$name])) return $this->settings[$name];
28  return $def;
29  }

Here is the caller graph for this function:

log (   $str,
  $level = self::LOG_NOTICE,
  $parms = array() 
)

log()

Definition at line 144 of file mailinglist_exportable.class.php.

References log_db(), log_file(), and log_screen().

Referenced by MailinglistPop3Retrieve\connect(), MailinglistPop3Retrieve\disconnect(), Mailman21List\getMemberPage(), MailinglistPhpImapRetrieve\purge_message(), MailinglistPop3Retrieve\recv_string(), MailinglistPop3Retrieve\send(), and MailinglistPop3Retrieve\send_cmd().

144  {
145  // Note, Value for levels are highest, for lowest priority events
146  if ($level <= $this->logging_db) {
147  $this->log_db($str, $parms, $level);
148  }
149  if ($level <= $this->logging_file) {
150  $this->log_file($str, $parms, $level);
151  }
152  if ($level <= $this->logging_screen) {
153  $this->log_screen($str, $parms, $level);
154  }
155  }
log_file($str, $parms=array(), $level=self::LOG_INFO)
log_file().
log_db($str, $parms=array(), $level=self::LOG_ERROR)
log_db().
log_screen($str, $parms=array(), $level=self::LOG_NOTICE)
log_screen()

Here is the call graph for this function:

Here is the caller graph for this function:

log_db (   $str,
  $parms = array(),
  $level = self::LOG_ERROR 
)

log_db().

Log a message to the watchdog Database logs.

Definition at line 189 of file mailinglist_exportable.class.php.

References $object_type.

Referenced by log().

189  {
190  $key = $this->object_type;
191  if(property_exists($this, 'admin_name')){
192  $key .= ' ' . $this->admin_name;
193  }
194  watchdog($this->object_type, $str, $parms, $level);
195  }
$object_type
The type of object we are.

Here is the caller graph for this function:

log_file (   $str,
  $parms = array(),
  $level = self::LOG_INFO 
)

log_file().

Log a message to a logfile.

Todo:

Definition at line 203 of file mailinglist_exportable.class.php.

Referenced by log().

203  {
204  }

Here is the caller graph for this function:

log_screen (   $str,
  $parms = array(),
  $level = self::LOG_NOTICE 
)

log_screen()

log a message to the screen

Todo:
Need to do substitution into $str

Definition at line 167 of file mailinglist_exportable.class.php.

Referenced by log().

167  {
168  // This array needs a member for each logging level
169  static $levels = array(
170  self::LOG_DEBUG => 'status',
171  self::LOG_INFO => 'status',
172  self::LOG_NOTICE => 'status',
173  self::LOG_WARNING => 'warning',
174  self::LOG_ERROR => 'error',
175  self::LOG_CRITICAL => 'error',
176  self::LOG_ALERT => 'error',
177  self::LOG_EMERGENCY => 'error',
178  );
180  dpm(t($str, $parms), $this->object_type, $levels[$level]);
181  }

Here is the caller graph for this function:

Field Documentation

$export_type

Needed by CTools.

Definition at line 16 of file mailinglist_exportable.class.php.

$logging_db = self::LOG_INFO

Definition at line 138 of file mailinglist_exportable.class.php.

$logging_file = self::LOG_DEBUG

Definition at line 139 of file mailinglist_exportable.class.php.

$logging_screen = self::LOG_DEBUG

Definition at line 137 of file mailinglist_exportable.class.php.

$object_type

The type of object we are.

Definition at line 14 of file mailinglist_exportable.class.php.

Referenced by log_db().

$settings

Generic Array to hold misc settings so all can use same schema.

Definition at line 15 of file mailinglist_exportable.class.php.

const LOG_ALERT = WATCHDOG_ALERT

Definition at line 134 of file mailinglist_exportable.class.php.

const LOG_CRITICAL = WATCHDOG_CRITICAL

Definition at line 133 of file mailinglist_exportable.class.php.

const LOG_DB = 2

Definition at line 121 of file mailinglist_exportable.class.php.

const LOG_DB_SCREEN = 3

Definition at line 122 of file mailinglist_exportable.class.php.

const LOG_DEBUG = WATCHDOG_DEBUG

Definition at line 128 of file mailinglist_exportable.class.php.

const LOG_EMERGENCY = WATCHDOG_EMERGENCY

Definition at line 135 of file mailinglist_exportable.class.php.

const LOG_ERROR = WATCHDOG_ERROR

Definition at line 132 of file mailinglist_exportable.class.php.

const LOG_FILE = 4

Definition at line 123 of file mailinglist_exportable.class.php.

const LOG_FILE_SCREEN = 5

Definition at line 124 of file mailinglist_exportable.class.php.

const LOG_INFO = WATCHDOG_INFO

Definition at line 129 of file mailinglist_exportable.class.php.

const LOG_NOTICE = WATCHDOG_NOTICE

Definition at line 130 of file mailinglist_exportable.class.php.

const LOG_OFF = 0

Definition at line 119 of file mailinglist_exportable.class.php.

const LOG_SCREEN = 1

Definition at line 120 of file mailinglist_exportable.class.php.

const LOG_WARNING = WATCHDOG_WARNING

Definition at line 131 of file mailinglist_exportable.class.php.


The documentation for this class was generated from the following file: