* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** * Default stage type for Scoutle. */ define('SCOUTLE_STAGE', 'dynamic180'); /** * The type of host system reported to Scoutle. */ define('SCOUTLE_HOST', 'drupal'); /** * Help text for the module. * @return HTML help text for the scoutle module. */ function scoutle_help($path, $arg) { switch ($path) { case 'admin/help#scoutle': return '
' . t('Support for the Scoutle social networking service. It enables the use of Scoutle stages that can be embedded in websites which connect blogs to other related blogs. In order to embed a stage, the website has to be registered with a scout on Scoutle, which will give you the scout hash necessary for configuring the stage.') . '
'; case 'admin/settings/scoutle': return '' . t('Configure the stage for Scoutle. The scout hash should be available at Scoutle if this website has been registered.') . '
'; } } /** * Valid permissions for the module. * @return An array of valid permissions for the scoutle module. */ function scoutle_permission() { return array( 'administer scoutle' => array( 'title' => t('Administer Scoutle'), 'description' => t('Administer the settings for the Scoutle stage.'), ), 'access scoutle stage' => array( 'title' => t('Access Scoutle stage'), 'description' => t('View the Scoutle stage.'), ), ); } /** * Return the blocks available from the scoutle module. * @return available blocks */ function scoutle_block_info() { $blocks['stage'] = array( 'info' => t('Scoutle stage'), 'cache' => DRUPAL_CACHE_GLOBAL, ); return $blocks; } /** * Generate HTML for a Scoutle block. * @param delta the block to return * @return a Scoutle block */ function scoutle_block_view($delta = '') { if ($delta != 'stage' || !user_access('access scoutle stage')) { return NULL; } $hash = urlencode(variable_get('scoutle_hash', '')); $stage = urlencode(variable_get('scoutle_stage', SCOUTLE_STAGE)); $host = SCOUTLE_HOST; // identifies type of host to Scoutle $message = t('Connect with me at Scoutle.com'); // for missing JavaScript if ($hash == '') { return NULL; // do not output widget } $block['subject'] = ''; if ($stage == 'static') { $block['content'] = <<