/modules/network/bpm_myspace/loader.php
PHP | 464 lines | 105 code | 110 blank | 249 comment | 6 complexity | 37b020edac8231afe6753464de363d9f MD5 | raw file
Possible License(s): AGPL-1.0, Apache-2.0, GPL-2.0, LGPL-2.1
- <?php
- /**
- * NETWORK MODULE - BPM MySpace
- *
- * @version 0.1.9
- * @since 0.1.9
- * @package BP-Media
- * @subpackage Network Modules
- * @license GPL v2.0
- * @link http://code.google.com/p/buddypress-media/
- *
- * ========================================================================================================
- */
- class BPNM_myspace extends BPM_networkModule_base implements iBPM_networkModule {
- var $name = "MySpace"; // Human readable name for this module
- var $slug = "bpm_myspace"; // Internal slug for this module
- // ============================================================================================================ //
- /**
- * Returns the human-readable name of the network module. This is displayed in the admin interface.
- * Example: "Video Gallery"
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return string | Network module admin name
- */
- public function getName(){
- return $this->name;
- }
- /**
- * Returns the url-safe slug for the network module. Must be unique from all other
- * network modules installed on the system. Example: "bpm_photo"
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return string | Network module slug
- */
- public function getSlug(){
- return $this->slug;
- }
- /**
- * Returns the guid of the network module as assigned by the database
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return int | Network module id
- */
- public function getId(){
- global $bpm;
- $result = $bpm->networkModules->getBySlug( $this->slug );
- return $result["module_id"];
- }
- /**
- * Returns the HTTP path to the module's icon. Icons MUST be 64px*64px .PNG files.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return string | path to icon file
- */
- public function getIconPath(){
- return BPM_URL_BASE . "/modules/network/bpm_myspace/admin/icon.png";
- }
- /**
- * Returns a short (30 words) description of what the network module does.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return string | description
- */
- public function getDesc(){
- return __("The MySpace network module lets BP-Media exchange media albums, photos, audio tracks, videos, and activity stream posts with
- users that have profiles on MySpace.","bp-media");
- }
- /**
- * Returns the network module's version number. 64 chars max.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return string | version number
- */
- public static function getVersion(){
- return "0.1.0";
- }
- /**
- * Returns a composited HTML string, including the name of the content module developer
- * and a link to their personal or company website.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return string | version number
- */
- public function getAuthor(){
- return "<a href='http://code.google.com/p/buddypress-media/'>The BP-Media Team</a>";
- }
- /**
- * Returns a composited HTML string containing a link to the network module's support page, or dedicated
- * project site. Example: <a href='http://code.google.com/p/buddypress-media/'>The BP-Media Team</a>
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return string | version number
- */
- public static function getSite(){
- return "<a href='http://code.google.com/p/buddypress-media/'>Support Forum</a>";
- }
- /**
- * Performs all of the network module's installation operations
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return bool | True on success. False on failure.
- */
- public function install(){
- global $bpm;
- $module_slug = self::getSlug();
- $result = array();
- if(!$bpm->config->createKey("networkModules", $module_slug, $key="setting_1", $val=6, $filter="int", $ctrl=null, $error=null) ) {$result[]=$key;}
- if(!$bpm->config->createKey("networkModules", $module_slug, $key="setting_2", $val=6, $filter="int", $ctrl=null, $error=null) ) {$result[]=$key;}
- if(!$bpm->config->createKey("networkModules", $module_slug, $key="setting_3", $val=6, $filter="int", $ctrl=null, $error=null) ) {$result[]=$key;}
- if( count($result) == 0){
-
- return true;
- }
- else {
- return false;
- }
- }
- /**
- * Performs all of the network module's uninstallation operations. Completely
- * removes the module from the system, and deletes all items stored within
- * networks that this module owns.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return bool | True on success. False on failure.
- */
- public function uninstall(){
- return true;
- }
- /**
- * Adds scripts used by the network module to the admin page header
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param string $page | Name of the admin page the plugin is rendering
- */
- public function enqueueAdminScripts(){
- }
- /**
- * Adds CSS styles used by the network module to the admin page header
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param string $page | Name of the admin page the plugin is rendering
- */
- public function enqueueAdminStyles(){
- wp_enqueue_style( self::getSlug(), BPM_URL_CORE .'/network_modules/bpm_audio/admin/admin.css', false, '2.8.1', 'screen' );
- }
- /**
- * Adds scripts used by the network module to the site page header
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param string $page | Name of the site page the plugin is rendering
- */
- public function enqueueSiteScripts($page){
- return $page;
- }
- /**
- * Adds CSS styles used by the network module to the site page header
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param string $page | Name of the site page the plugin is rendering
- */
- public function enqueueSiteStyles($page){
- return $page;
- }
- /**
- * Network module init function. Network modules place all of their hook and filter functions in the init
- * function inside their class. When the core loads network modules, it fires the init function in each
- * network module, attaching the module's functions to the core.
- *
- * @version 0.1.9
- * @since 0.1.9
- */
- public function init(){
- return true;
- }
- /**
- * Renders the configuration page for a network module, as seen on the admin
- * "network modules" screen.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return string | composited HTML block
- */
- public function adminConfigPage(){
- global $bpm;
- require ( dirname( __FILE__ ) . '/admin/loader.php' );
- $current_page = new BPNM_admin_page( self::getId() );
-
- }
- /**
- * Renders the configuration page for a network module, as seen on the user's
- * site settings screens.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @return string | composited HTML block
- */
- public function userConfigPage(){
- }
- /**
- * Renders the HTML block for the page a user sees when they create a new
- * instance of an network type owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_createNetwork(){
- }
- /**
- * Renders the HTML block for an upload page when items are uploaded to an
- * network type owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_uploadItem(){
- }
- /**
- * Renders the HTML block for the page a user sees when they edit an
- * instance of an network type owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_editNetwork(){
- }
- /**
- * Renders the HTML block for the page a user sees when they edit an individual
- * network item within an instance of an network type owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_editItem(){
- }
- /**
- * Renders the HTML block for the first page of items a user sees when they
- * view an instance of an network type owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_landingPage(){
- }
- /**
- * Renders the HTML block for for the second and subsequent pages of items a user
- * sees when they view an instance of an network type owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_galleryPage(){
- }
- /**
- * Renders the HTML block for the page a user sees when they view an individual
- * item within an network instance owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_singlePage(){
- }
- /**
- * Renders the HTML block for the page a user sees when they sort items within
- * an network instance owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_sortPage(){
- }
- /**
- * Renders the HTML block for the page a user sees when they apply user tags to a
- * network item within an network instance owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_userTagPage(){
- }
- /**
- * Renders the HTML block for the page a user sees when they apply keyword tags to
- * a network item within an network instance owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_keywordTagPage(){
- }
- /**
- * Renders the HTML block for the page a user sees when they add geotagging info to
- * a network item within an network instance owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_geoTagPage(){
- }
- /**
- * Renders the HTML block for the page a user sees when they add licensing info to
- * a network item within an network instance owned by the network module.
- *
- * @version 0.1.9
- * @since 0.1.9
- * @param ?
- * @return string | composited HTML block
- */
- public function render_licenseTagPage(){
- }
- public function register(){
- global $bpm;
- $slug = $this->getSlug();
- $name = $this->getName();
- $php_class = get_class($this);
- $bpm->networkModules->register($slug, $name, $php_class);
- }
-
- }
- $temp = new BPNM_myspace();
- $temp->register();
- unset($temp);
- ?>