PageRenderTime 26ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/network/bpm_myspace/loader.php

http://buddypress-media.googlecode.com/
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
  1. <?php
  2. /**
  3. * NETWORK MODULE - BPM MySpace
  4. *
  5. * @version 0.1.9
  6. * @since 0.1.9
  7. * @package BP-Media
  8. * @subpackage Network Modules
  9. * @license GPL v2.0
  10. * @link http://code.google.com/p/buddypress-media/
  11. *
  12. * ========================================================================================================
  13. */
  14. class BPNM_myspace extends BPM_networkModule_base implements iBPM_networkModule {
  15. var $name = "MySpace"; // Human readable name for this module
  16. var $slug = "bpm_myspace"; // Internal slug for this module
  17. // ============================================================================================================ //
  18. /**
  19. * Returns the human-readable name of the network module. This is displayed in the admin interface.
  20. * Example: "Video Gallery"
  21. *
  22. * @version 0.1.9
  23. * @since 0.1.9
  24. * @return string | Network module admin name
  25. */
  26. public function getName(){
  27. return $this->name;
  28. }
  29. /**
  30. * Returns the url-safe slug for the network module. Must be unique from all other
  31. * network modules installed on the system. Example: "bpm_photo"
  32. *
  33. * @version 0.1.9
  34. * @since 0.1.9
  35. * @return string | Network module slug
  36. */
  37. public function getSlug(){
  38. return $this->slug;
  39. }
  40. /**
  41. * Returns the guid of the network module as assigned by the database
  42. *
  43. * @version 0.1.9
  44. * @since 0.1.9
  45. * @return int | Network module id
  46. */
  47. public function getId(){
  48. global $bpm;
  49. $result = $bpm->networkModules->getBySlug( $this->slug );
  50. return $result["module_id"];
  51. }
  52. /**
  53. * Returns the HTTP path to the module's icon. Icons MUST be 64px*64px .PNG files.
  54. *
  55. * @version 0.1.9
  56. * @since 0.1.9
  57. * @return string | path to icon file
  58. */
  59. public function getIconPath(){
  60. return BPM_URL_BASE . "/modules/network/bpm_myspace/admin/icon.png";
  61. }
  62. /**
  63. * Returns a short (30 words) description of what the network module does.
  64. *
  65. * @version 0.1.9
  66. * @since 0.1.9
  67. * @return string | description
  68. */
  69. public function getDesc(){
  70. return __("The MySpace network module lets BP-Media exchange media albums, photos, audio tracks, videos, and activity stream posts with
  71. users that have profiles on MySpace.","bp-media");
  72. }
  73. /**
  74. * Returns the network module's version number. 64 chars max.
  75. *
  76. * @version 0.1.9
  77. * @since 0.1.9
  78. * @return string | version number
  79. */
  80. public static function getVersion(){
  81. return "0.1.0";
  82. }
  83. /**
  84. * Returns a composited HTML string, including the name of the content module developer
  85. * and a link to their personal or company website.
  86. *
  87. * @version 0.1.9
  88. * @since 0.1.9
  89. * @return string | version number
  90. */
  91. public function getAuthor(){
  92. return "<a href='http://code.google.com/p/buddypress-media/'>The BP-Media Team</a>";
  93. }
  94. /**
  95. * Returns a composited HTML string containing a link to the network module's support page, or dedicated
  96. * project site. Example: <a href='http://code.google.com/p/buddypress-media/'>The BP-Media Team</a>
  97. *
  98. * @version 0.1.9
  99. * @since 0.1.9
  100. * @return string | version number
  101. */
  102. public static function getSite(){
  103. return "<a href='http://code.google.com/p/buddypress-media/'>Support Forum</a>";
  104. }
  105. /**
  106. * Performs all of the network module's installation operations
  107. *
  108. * @version 0.1.9
  109. * @since 0.1.9
  110. * @return bool | True on success. False on failure.
  111. */
  112. public function install(){
  113. global $bpm;
  114. $module_slug = self::getSlug();
  115. $result = array();
  116. if(!$bpm->config->createKey("networkModules", $module_slug, $key="setting_1", $val=6, $filter="int", $ctrl=null, $error=null) ) {$result[]=$key;}
  117. if(!$bpm->config->createKey("networkModules", $module_slug, $key="setting_2", $val=6, $filter="int", $ctrl=null, $error=null) ) {$result[]=$key;}
  118. if(!$bpm->config->createKey("networkModules", $module_slug, $key="setting_3", $val=6, $filter="int", $ctrl=null, $error=null) ) {$result[]=$key;}
  119. if( count($result) == 0){
  120. return true;
  121. }
  122. else {
  123. return false;
  124. }
  125. }
  126. /**
  127. * Performs all of the network module's uninstallation operations. Completely
  128. * removes the module from the system, and deletes all items stored within
  129. * networks that this module owns.
  130. *
  131. * @version 0.1.9
  132. * @since 0.1.9
  133. * @return bool | True on success. False on failure.
  134. */
  135. public function uninstall(){
  136. return true;
  137. }
  138. /**
  139. * Adds scripts used by the network module to the admin page header
  140. *
  141. * @version 0.1.9
  142. * @since 0.1.9
  143. * @param string $page | Name of the admin page the plugin is rendering
  144. */
  145. public function enqueueAdminScripts(){
  146. }
  147. /**
  148. * Adds CSS styles used by the network module to the admin page header
  149. *
  150. * @version 0.1.9
  151. * @since 0.1.9
  152. * @param string $page | Name of the admin page the plugin is rendering
  153. */
  154. public function enqueueAdminStyles(){
  155. wp_enqueue_style( self::getSlug(), BPM_URL_CORE .'/network_modules/bpm_audio/admin/admin.css', false, '2.8.1', 'screen' );
  156. }
  157. /**
  158. * Adds scripts used by the network module to the site page header
  159. *
  160. * @version 0.1.9
  161. * @since 0.1.9
  162. * @param string $page | Name of the site page the plugin is rendering
  163. */
  164. public function enqueueSiteScripts($page){
  165. return $page;
  166. }
  167. /**
  168. * Adds CSS styles used by the network module to the site page header
  169. *
  170. * @version 0.1.9
  171. * @since 0.1.9
  172. * @param string $page | Name of the site page the plugin is rendering
  173. */
  174. public function enqueueSiteStyles($page){
  175. return $page;
  176. }
  177. /**
  178. * Network module init function. Network modules place all of their hook and filter functions in the init
  179. * function inside their class. When the core loads network modules, it fires the init function in each
  180. * network module, attaching the module's functions to the core.
  181. *
  182. * @version 0.1.9
  183. * @since 0.1.9
  184. */
  185. public function init(){
  186. return true;
  187. }
  188. /**
  189. * Renders the configuration page for a network module, as seen on the admin
  190. * "network modules" screen.
  191. *
  192. * @version 0.1.9
  193. * @since 0.1.9
  194. * @return string | composited HTML block
  195. */
  196. public function adminConfigPage(){
  197. global $bpm;
  198. require ( dirname( __FILE__ ) . '/admin/loader.php' );
  199. $current_page = new BPNM_admin_page( self::getId() );
  200. }
  201. /**
  202. * Renders the configuration page for a network module, as seen on the user's
  203. * site settings screens.
  204. *
  205. * @version 0.1.9
  206. * @since 0.1.9
  207. * @return string | composited HTML block
  208. */
  209. public function userConfigPage(){
  210. }
  211. /**
  212. * Renders the HTML block for the page a user sees when they create a new
  213. * instance of an network type owned by the network module.
  214. *
  215. * @version 0.1.9
  216. * @since 0.1.9
  217. * @param ?
  218. * @return string | composited HTML block
  219. */
  220. public function render_createNetwork(){
  221. }
  222. /**
  223. * Renders the HTML block for an upload page when items are uploaded to an
  224. * network type owned by the network module.
  225. *
  226. * @version 0.1.9
  227. * @since 0.1.9
  228. * @param ?
  229. * @return string | composited HTML block
  230. */
  231. public function render_uploadItem(){
  232. }
  233. /**
  234. * Renders the HTML block for the page a user sees when they edit an
  235. * instance of an network type owned by the network module.
  236. *
  237. * @version 0.1.9
  238. * @since 0.1.9
  239. * @param ?
  240. * @return string | composited HTML block
  241. */
  242. public function render_editNetwork(){
  243. }
  244. /**
  245. * Renders the HTML block for the page a user sees when they edit an individual
  246. * network item within an instance of an network type owned by the network module.
  247. *
  248. * @version 0.1.9
  249. * @since 0.1.9
  250. * @param ?
  251. * @return string | composited HTML block
  252. */
  253. public function render_editItem(){
  254. }
  255. /**
  256. * Renders the HTML block for the first page of items a user sees when they
  257. * view an instance of an network type owned by the network module.
  258. *
  259. * @version 0.1.9
  260. * @since 0.1.9
  261. * @param ?
  262. * @return string | composited HTML block
  263. */
  264. public function render_landingPage(){
  265. }
  266. /**
  267. * Renders the HTML block for for the second and subsequent pages of items a user
  268. * sees when they view an instance of an network type owned by the network module.
  269. *
  270. * @version 0.1.9
  271. * @since 0.1.9
  272. * @param ?
  273. * @return string | composited HTML block
  274. */
  275. public function render_galleryPage(){
  276. }
  277. /**
  278. * Renders the HTML block for the page a user sees when they view an individual
  279. * item within an network instance owned by the network module.
  280. *
  281. * @version 0.1.9
  282. * @since 0.1.9
  283. * @param ?
  284. * @return string | composited HTML block
  285. */
  286. public function render_singlePage(){
  287. }
  288. /**
  289. * Renders the HTML block for the page a user sees when they sort items within
  290. * an network instance owned by the network module.
  291. *
  292. * @version 0.1.9
  293. * @since 0.1.9
  294. * @param ?
  295. * @return string | composited HTML block
  296. */
  297. public function render_sortPage(){
  298. }
  299. /**
  300. * Renders the HTML block for the page a user sees when they apply user tags to a
  301. * network item within an network instance owned by the network module.
  302. *
  303. * @version 0.1.9
  304. * @since 0.1.9
  305. * @param ?
  306. * @return string | composited HTML block
  307. */
  308. public function render_userTagPage(){
  309. }
  310. /**
  311. * Renders the HTML block for the page a user sees when they apply keyword tags to
  312. * a network item within an network instance owned by the network module.
  313. *
  314. * @version 0.1.9
  315. * @since 0.1.9
  316. * @param ?
  317. * @return string | composited HTML block
  318. */
  319. public function render_keywordTagPage(){
  320. }
  321. /**
  322. * Renders the HTML block for the page a user sees when they add geotagging info to
  323. * a network item within an network instance owned by the network module.
  324. *
  325. * @version 0.1.9
  326. * @since 0.1.9
  327. * @param ?
  328. * @return string | composited HTML block
  329. */
  330. public function render_geoTagPage(){
  331. }
  332. /**
  333. * Renders the HTML block for the page a user sees when they add licensing info to
  334. * a network item within an network instance owned by the network module.
  335. *
  336. * @version 0.1.9
  337. * @since 0.1.9
  338. * @param ?
  339. * @return string | composited HTML block
  340. */
  341. public function render_licenseTagPage(){
  342. }
  343. public function register(){
  344. global $bpm;
  345. $slug = $this->getSlug();
  346. $name = $this->getName();
  347. $php_class = get_class($this);
  348. $bpm->networkModules->register($slug, $name, $php_class);
  349. }
  350. }
  351. $temp = new BPNM_myspace();
  352. $temp->register();
  353. unset($temp);
  354. ?>