user_details_admin_settings.inc 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. <?php
  2. function user_details_admin_settings() {
  3. // Add the css that is needed for the admin form
  4. drupal_add_css(drupal_get_path('module', 'user_details') . '/css/user_details_admin.css');
  5. $overview = t('The User Details module is a simple module to help the end-user find thier way around a website by adding a central location for important link, stats, and thier content.');
  6. $overview .= '<br/>';
  7. $overview .= t('The User Details module is broken up into two blocks: logged-in and authored by. For a more detailed overview please visit the ') . '<a href="/admin/help/user_details">' . t('User Details help page') . '</a>';
  8. $loggedin_header = '<hr>';
  9. $loggedin_header .= '<h3>' . t('User Details: logged-in user settings') . '</h3>';
  10. $authored_header = '<hr>';
  11. $authored_header .= '<h3>' . t('User Details: authored user settings') . '</h3>';
  12. $hr = '<hr>';
  13. $form['overview'] = array(
  14. '#markup' => $overview,
  15. );
  16. $form['loggedin_header'] = array(
  17. '#markup' => $loggedin_header,
  18. );
  19. $form['loggedin_stats'] = array(
  20. '#type' => 'fieldset',
  21. '#title' => 'User Stats.',
  22. '#collapsible' => 'true',
  23. '#collapsed' => 'true',
  24. );
  25. $form['loggedin_stats']['user_details_loggedin_avatar_display'] = array(
  26. '#type' => 'checkbox',
  27. '#title' => t('Display the "User Avatar".'),
  28. '#default_value' => variable_get('user_details_loggedin_avatar_display', FALSE),
  29. '#description' => t('Displays the Avatar of the user, if any is available.')
  30. );
  31. $form['loggedin_stats']['user_details_loggedin_joined_display'] = array(
  32. '#type' => 'checkbox',
  33. '#title' => t('Display the "Joined Date".'),
  34. '#default_value' => variable_get('user_details_loggedin_joined_display', FALSE),
  35. '#description' => t('Displays the account creation date of the user.')
  36. );
  37. $form['loggedin_stats']['user_details_loggedin_postcount_display'] = array(
  38. '#type' => 'checkbox',
  39. '#title' => t('Display the "Post count"'),
  40. '#default_value' => variable_get('user_details_loggedin_postcount_display', FALSE),
  41. '#description' => t('Displays the user\'s current number of posts.'),
  42. );
  43. if (module_exists('userpoints')) {
  44. $form['loggedin_stats']['user_details_loggedin_points_display'] = array(
  45. '#type' => 'checkbox',
  46. '#title' => t('Display the "User Points".'),
  47. '#default_value' => variable_get('user_details_loggedin_points_display', FALSE),
  48. '#description' => t('Displays the user\'s "User Points" amount.'),
  49. '#disabled' => FALSE,
  50. );
  51. }
  52. else {
  53. $form['loggedin_stats']['user_details_loggedin_points_display'] = array(
  54. '#type' => 'checkbox',
  55. '#title' => t('Display the "User Points".'),
  56. '#default_value' => variable_get('user_details_loggedin_points_display', FALSE),
  57. '#description' => t('Please install <a href="http://drupal.org/project/userpoints">User Points</a>'),
  58. '#disabled' => TRUE,
  59. );
  60. }
  61. $form['loggedin_stats']['user_details_loggedin_rank_display'] = array(
  62. '#type' => 'checkbox',
  63. '#title' => t('Display the role.'),
  64. '#default_value' => variable_get('user_details_loggedin_rank_display', FALSE),
  65. '#description' => t('Displays the user\'s role name.'),
  66. );
  67. if (module_exists('privatemsg')) {
  68. $form['loggedin_stats']['user_details_loggedin_privatemsg_display'] = array(
  69. '#type' => 'checkbox',
  70. '#title' => t('Display the unread message amount.'),
  71. '#default_value' => variable_get('user_details_loggedin_privatemsg_display', FALSE),
  72. '#description' => t('Displays the unread message amount from the "Private Messages" module.'),
  73. '#disabled' => FALSE,
  74. );
  75. }
  76. else {
  77. $form['loggedin_stats']['user_details_loggedin_privatemsg_display'] = array(
  78. '#type' => 'checkbox',
  79. '#title' => t('Display the unread message amount.'),
  80. '#default_value' => variable_get('user_details_loggedin_privatemsg_display', FALSE),
  81. '#description' => t('Please install <a href="http://drupal.org/project/privatemsg">Private Messages</a>'),
  82. '#disabled' => TRUE,
  83. );
  84. }
  85. $form['loggedin_stats_hr'] = array(
  86. '#type' => 'fieldset',
  87. '#title' => 'Horizontal Ruler.',
  88. '#collapsible' => 'true',
  89. '#collapsed' => 'true',
  90. );
  91. $form['loggedin_stats_hr']['user_details_loggedin_stats_hr_display'] = array(
  92. '#type' => 'checkbox',
  93. '#title' => t('Display "HR"'),
  94. '#default_value' => variable_get('user_details_loggedin_stats_hr_display', FALSE),
  95. '#description' => t('Displays a hortizontal ruler html enity seprating the stats and links sections.'),
  96. );
  97. //Links Options
  98. $form['loggedin_links'] = array(
  99. '#type' => 'fieldset',
  100. '#title' => 'Links.',
  101. '#collapsible' => 'true',
  102. '#collapsed' => 'true',
  103. );
  104. $form['loggedin_links']['front_link'] = array(
  105. '#type' => 'fieldset',
  106. '#title' => t('Front Link'),
  107. '#collapsible' => 'true',
  108. '#collapsed' => 'true',
  109. );
  110. $form['loggedin_links']['front_link']['user_details_loggedin_frontlink_display'] = array(
  111. '#type' => 'checkbox',
  112. '#title' => t('Display'),
  113. '#default_value' => variable_get('user_details_loggedin_frontlink_display', FALSE),
  114. '#description' => t('Displays an icon link leading to the site\'s front page.'),
  115. );
  116. $form['loggedin_links']['front_link']['user_details_loggedin_frontlink_imgsrc'] = array(
  117. '#type' => 'textfield',
  118. '#title' => t('Image source.'),
  119. '#default_value' => variable_get('user_details_loggedin_frontlink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/front-icon.png"),
  120. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/front-icon.png</i>'),
  121. '#size' => 75,
  122. '#maxlength' => 500,
  123. );
  124. $form['loggedin_links']['profile_link'] = array(
  125. '#type' => 'fieldset',
  126. '#title' => t('Profile Link'),
  127. '#collapsible' => 'true',
  128. '#collapsed' => 'true',
  129. );
  130. $form['loggedin_links']['profile_link']['user_details_loggedin_profilelink_display'] = array(
  131. '#type' => 'checkbox',
  132. '#title' => t('Display'),
  133. '#default_value' => variable_get('user_details_loggedin_profilelink_display', FALSE),
  134. '#description' => t('Displays an icon link leading to the user\'s profile page.'),
  135. );
  136. $form['loggedin_links']['profile_link']['user_details_loggedin_profilelink_imgsrc'] = array(
  137. '#type' => 'textfield',
  138. '#title' => t('Image source.'),
  139. '#default_value' => variable_get('user_details_loggedin_profilelink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/profile-icon.png"),
  140. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/profile-icon.png</i>'),
  141. '#size' => 75,
  142. '#maxlength' => 500,
  143. );
  144. $form['loggedin_links']['profile_edit_link'] = array(
  145. '#type' => 'fieldset',
  146. '#title' => t('Profile Edit Link'),
  147. '#collapsible' => 'true',
  148. '#collapsed' => 'true',
  149. );
  150. $form['loggedin_links']['profile_edit_link']['user_details_loggedin_profileeditlink_display'] = array(
  151. '#type' => 'checkbox',
  152. '#title' => t('Display'),
  153. '#default_value' => variable_get('user_details_loggedin_profileeditlink_display', FALSE),
  154. '#description' => t('Displays an icon link leading to the user\'s edit profile page.')
  155. );
  156. $form['loggedin_links']['profile_edit_link']['user_details_loggedin_profileeditlink_imgsrc'] = array(
  157. '#type' => 'textfield',
  158. '#title' => t('Image source.'),
  159. '#default_value' => variable_get('user_details_loggedin_profileeditlink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/profileedit-icon.png"),
  160. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/profileedit-icon.png</i>'),
  161. '#size' => 75,
  162. '#maxlength' => 500,
  163. );
  164. $form['loggedin_links']['privatemsg_link'] = array(
  165. '#type' => 'fieldset',
  166. '#title' => t('Private Message Link'),
  167. '#collapsible' => 'true',
  168. '#collapsed' => 'true',
  169. );
  170. if (module_exists('privatemsg')) {
  171. $form['loggedin_links']['privatemsg_link']['user_details_loggedin_privatemsglink_display'] = array(
  172. '#type' => 'checkbox',
  173. '#title' => t('Display'),
  174. '#default_value' => variable_get('user_details_loggedin_privatemsglink_display', FALSE),
  175. '#description' => t('Displays an icon link leading to the user\'s private message profile page.'),
  176. '#disabled' => FALSE,
  177. );
  178. }
  179. else {
  180. $form['loggedin_links']['privatemsg_link']['user_details_loggedin_privatemsglink_display'] = array(
  181. '#type' => 'checkbox',
  182. '#title' => t('Display'),
  183. '#default_value' => variable_get('user_details_loggedin_privatemsglink_display', FALSE),
  184. '#description' => t('please install <a href="http://drupal.org/project/privatemsg">Private Message</a>.'),
  185. '#disabled' => TRUE,
  186. );
  187. }
  188. if (module_exists('privatemsg')) {
  189. $form['loggedin_links']['privatemsg_link']['user_details_loggedin_privatemsglink_imgsrc'] = array(
  190. '#type' => 'textfield',
  191. '#title' => t('Image source.'),
  192. '#default_value' => variable_get('user_details_loggedin_privatemsg_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/privatemsg-icon.png"),
  193. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/privatemsg-icon.png</i>'),
  194. '#size' => 75,
  195. '#maxlength' => 500,
  196. );
  197. }
  198. $form['loggedin_links']['create_link'] = array(
  199. '#type' => 'fieldset',
  200. '#title' => t('Create Link'),
  201. '#collapsible' => 'true',
  202. '#collapsed' => 'true',
  203. );
  204. $form['loggedin_links']['create_link']['user_details_loggedin_createlink_display'] = array(
  205. '#type' => 'checkbox',
  206. '#title' => t('Display'),
  207. '#default_value' => variable_get('user_details_loggedin_createlink_display', FALSE),
  208. '#description' => t('Displays an icon link to the /node/add page'),
  209. );
  210. $form['loggedin_links']['create_link']['user_details_loggedin_createlink_imgsrc'] = array(
  211. '#type' => 'textfield',
  212. '#title' => t('Image source.'),
  213. '#default_value' => variable_get('user_details_loggedin_createlink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/create-icon.png"),
  214. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/create-icon.png</i>'),
  215. '#size' => 75,
  216. '#maxlength' => 500,
  217. );
  218. $form['loggedin_links']['admin_link'] = array(
  219. '#type' => 'fieldset',
  220. '#title' => t('Admin Link'),
  221. '#collapsible' => 'true',
  222. '#collapsed' => 'true',
  223. );
  224. $form['loggedin_links']['admin_link']['user_details_loggedin_adminlink_display'] = array(
  225. '#type' => 'checkbox',
  226. '#title' => t('Display'),
  227. '#default_value' => variable_get('user_details_loggedin_adminlink_display', FALSE),
  228. '#description' => t('Displays an icon link to the admin page.')
  229. );
  230. $form['loggedin_links']['admin_link']['user_details_loggedin_adminlink_imgsrc'] = array(
  231. '#type' => 'textfield',
  232. '#title' => t('Image source.'),
  233. '#default_value' => variable_get('user_details_loggedin_adminlink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/admin-icon.png"),
  234. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/admin-icon.png</i>'),
  235. '#size' => 75,
  236. '#maxlength' => 500,
  237. );
  238. $form['loggedin_links']['panels_link'] = array(
  239. '#type' => 'fieldset',
  240. '#title' => t('Panels Link'),
  241. '#collapsible' => 'true',
  242. '#collapsed' => 'true',
  243. );
  244. if (module_exists('panels')) {
  245. $form['loggedin_links']['panels_link']['user_details_loggedin_panelslink_display'] = array(
  246. '#type' => 'checkbox',
  247. '#title' => t('Display'),
  248. '#default_value' => variable_get('user_details_loggedin_panelslink_display', FALSE),
  249. '#description' => t('Displays an icon link to the admin section of the "Panels" module.')
  250. );
  251. }
  252. else {
  253. $form['loggedin_links']['panels_link']['user_details_loggedin_panelslink_display'] = array(
  254. '#type' => 'checkbox',
  255. '#title' => t('Display'),
  256. '#default_value' => variable_get('user_details_loggedin_panelslink_display', FALSE),
  257. '#description' => t('Please install <a href="http://drupal.org/project/panels">Panels</a>'),
  258. '#disabled' => TRUE,
  259. );
  260. }
  261. if (module_exists('panels')) {
  262. $form['loggedin_links']['panels_link']['user_details_loggedin_panelslink_imgsrc'] = array(
  263. '#type' => 'textfield',
  264. '#title' => t('Image source.'),
  265. '#default_value' => variable_get('user_details_loggedin_panelslink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/panels-icon.png"),
  266. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/panels-icon.png</i>'),
  267. '#size' => 75,
  268. '#maxlength' => 500,
  269. );
  270. }
  271. $form['loggedin_links']['views_link'] = array(
  272. '#type' => 'fieldset',
  273. '#title' => t('Views Link'),
  274. '#collapsible' => 'true',
  275. '#collapsed' => 'true',
  276. );
  277. if (module_exists('views')) {
  278. $form['loggedin_links']['views_link']['user_details_loggedin_viewslink_display'] = array(
  279. '#type' => 'checkbox',
  280. '#title' => t('Display'),
  281. '#default_value' => variable_get('user_details_loggedin_viewslink_display', FALSE),
  282. '#description' => t('Displays an icon link to the admin section of the "Views" module.')
  283. );
  284. }
  285. else {
  286. $form['loggedin_links']['views_link']['user_details_loggedin_viewslink_display'] = array(
  287. '#type' => 'checkbox',
  288. '#title' => t('Display'),
  289. '#default_value' => variable_get('user_details_loggedin_viewslink_display', FALSE),
  290. '#description' => t('Please install <a href="http://drupal.org/project/views">Panels</a>'),
  291. '#disabled' => TRUE,
  292. );
  293. }
  294. if (module_exists('views')) {
  295. $form['loggedin_links']['views_link']['user_details_loggedin_viewslink_imgsrc'] = array(
  296. '#type' => 'textfield',
  297. '#title' => t('Image source.'),
  298. '#default_value' => variable_get('user_details_loggedin_viewslink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/views-icon.png"),
  299. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/views-icon.png</i>'),
  300. '#size' => 75,
  301. '#maxlength' => 500,
  302. );
  303. }
  304. $form['loggedin_links']['performance_link'] = array(
  305. '#type' => 'fieldset',
  306. '#title' => t('Performance Link'),
  307. '#collapsible' => 'true',
  308. '#collapsed' => 'true',
  309. );
  310. $form['loggedin_links']['performance_link']['user_details_loggedin_performancelink_display'] = array(
  311. '#type' => 'checkbox',
  312. '#title' => t('Display'),
  313. '#default_value' => variable_get('user_details_loggedin_performancelink_display', FALSE),
  314. '#description' => t('Displays an icon link to the admin section of the "Views" module.')
  315. );
  316. $form['loggedin_links']['performance_link']['user_details_loggedin_performancelink_imgsrc'] = array(
  317. '#type' => 'textfield',
  318. '#title' => t('Image source.'),
  319. '#default_value' => variable_get('user_details_loggedin_performancelink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/performance-icon.png"),
  320. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/performance-icon.png</i>'),
  321. '#size' => 75,
  322. '#maxlength' => 500,
  323. );
  324. $form['loggedin_links']['logout_link'] = array(
  325. '#type' => 'fieldset',
  326. '#title' => t('Logout Link'),
  327. '#collapsible' => 'true',
  328. '#collapsed' => 'true',
  329. );
  330. $form['loggedin_links']['logout_link']['user_details_loggedin_logoutlink_display'] = array(
  331. '#type' => 'checkbox',
  332. '#title' => t('Display'),
  333. '#default_value' => variable_get('user_details_loggedin_logoutlink_display', FALSE),
  334. '#description' => t('Displays an icon link to allow the user to logout.')
  335. );
  336. $form['loggedin_links']['logout_link']['user_details_loggedin_logoutlink_imgsrc'] = array(
  337. '#type' => 'textfield',
  338. '#title' => t('Image source.'),
  339. '#default_value' => variable_get('user_details_loggedin_logoutlink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/logout-icon.png"),
  340. '#description' => t('It is the URL relative to your drupal install. Do not include your domain name.(http://www.example.com)'),
  341. '#size' => 75,
  342. '#maxlength' => 500,
  343. );
  344. //Custom Link One Options
  345. $form['loggedin_links']['custom_link_one'] = array(
  346. '#type' => 'fieldset',
  347. '#title' => t('Custom Link One'),
  348. '#collapsible' => 'true',
  349. '#collapsed' => 'true',
  350. );
  351. $form['loggedin_links']['custom_link_one']['user_details_loggedin_customlinkone_type'] = array(
  352. '#type' => 'select',
  353. '#title' => t('Link Type'),
  354. '#options' => array(
  355. 0 => t('Disabled'),
  356. 2 => t('User Link'),
  357. 3 => t('Admin Link'),
  358. ),
  359. '#default_value' => variable_get('user_details_loggedin_customlinkone_type', '0'),
  360. '#description' => t('Choose which type of link this link is.'),
  361. );
  362. $form['loggedin_links']['custom_link_one']['user_details_loggedin_customlinkone_url'] = array(
  363. '#type' => 'textfield',
  364. '#title' => t('URL path.'),
  365. '#default_value' => variable_get('user_details_loggedin_customlinkone_url', ''),
  366. '#description' => t('the url of the page you want this link to refer to. (example: /admin/structure/pages)'),
  367. '#size' => 75,
  368. '#maxlength' => 500,
  369. );
  370. $form['loggedin_links']['custom_link_one']['user_details_loggedin_customlinkone_imgsrc'] = array(
  371. '#type' => 'textfield',
  372. '#title' => t('Image path.'),
  373. '#default_value' => variable_get('user_details_loggedin_customlinkone_imgsrc', ''),
  374. '#description' => t('the path to your image. (example: /sites/all/themes/my-theme/custom-link-one.png)'),
  375. '#size' => 75,
  376. '#maxlength' => 500,
  377. );
  378. $form['loggedin_links']['custom_link_one']['user_details_loggedin_customlinkone_imgtitle'] = array(
  379. '#type' => 'textfield',
  380. '#title' => t('Image title.'),
  381. '#default_value' => variable_get('user_details_loggedin_customlinkone_imgtitle', ''),
  382. '#description' => t('The image title, or mouse-over tooltip, of the image.'),
  383. '#size' => 75,
  384. '#maxlength' => 500,
  385. );
  386. //Custom Link Two Options
  387. $form['loggedin_links']['custom_link_two'] = array(
  388. '#type' => 'fieldset',
  389. '#title' => t('Custom Link Two'),
  390. '#collapsible' => 'true',
  391. '#collapsed' => 'true',
  392. );
  393. $form['loggedin_links']['custom_link_two']['user_details_loggedin_customlinktwo_type'] = array(
  394. '#type' => 'select',
  395. '#title' => t('Link Type'),
  396. '#options' => array(
  397. 0 => t('Disabled'),
  398. 2 => t('User Link'),
  399. 3 => t('Admin Link'),
  400. ),
  401. '#default_value' => variable_get('user_details_loggedin_customlinktwo_type', '0'),
  402. '#description' => t('Choose which type of link this link is.'),
  403. );
  404. $form['loggedin_links']['custom_link_two']['user_details_loggedin_customlinktwo_url'] = array(
  405. '#type' => 'textfield',
  406. '#title' => t('URL path.'),
  407. '#default_value' => variable_get('user_details_loggedin_customlinktwo_url', ''),
  408. '#description' => t('the url of the page you want this link to refer to. (example: /admin/structure/pages)'),
  409. '#size' => 75,
  410. '#maxlength' => 500,
  411. );
  412. $form['loggedin_links']['custom_link_two']['user_details_loggedin_customlinktwo_imgsrc'] = array(
  413. '#type' => 'textfield',
  414. '#title' => t('Image path.'),
  415. '#default_value' => variable_get('user_details_loggedin_customlinktwo_imgsrc', ''),
  416. '#description' => t('the path to your image. (example: /sites/all/themes/my-theme/custom-link-two.png)'),
  417. '#size' => 75,
  418. '#maxlength' => 500,
  419. );
  420. $form['loggedin_links']['custom_link_two']['user_details_loggedin_customlinktwo_imgtitle'] = array(
  421. '#type' => 'textfield',
  422. '#title' => t('Image title.'),
  423. '#default_value' => variable_get('user_details_loggedin_customlinktwo_imgtitle', ''),
  424. '#description' => t('The image title, or mouse-over tooltip, of the image.'),
  425. '#size' => 75,
  426. '#maxlength' => 500,
  427. );
  428. //Custom Link Three Options
  429. $form['loggedin_links']['custom_link_three'] = array(
  430. '#type' => 'fieldset',
  431. '#title' => t('Custom Link Three'),
  432. '#collapsible' => 'true',
  433. '#collapsed' => 'true',
  434. );
  435. $form['loggedin_links']['custom_link_three']['user_details_loggedin_customlinkthree_type'] = array(
  436. '#type' => 'select',
  437. '#title' => t('Link Type'),
  438. '#options' => array(
  439. 0 => t('Disabled'),
  440. 2 => t('User Link'),
  441. 3 => t('Admin Link'),
  442. ),
  443. '#default_value' => variable_get('user_details_loggedin_customlinkthree_type', '0'),
  444. '#description' => t('Choose which type of link this link is.'),
  445. );
  446. $form['loggedin_links']['custom_link_three']['user_details_loggedin_customlinkthree_url'] = array(
  447. '#type' => 'textfield',
  448. '#title' => t('URL path.'),
  449. '#default_value' => variable_get('user_details_loggedin_customlinkthree_url', ''),
  450. '#description' => t('the url of the page you want this link to refer to. (example: /admin/structure/pages)'),
  451. '#size' => 75,
  452. '#maxlength' => 500,
  453. );
  454. $form['loggedin_links']['custom_link_three']['user_details_loggedin_customlinkthree_imgsrc'] = array(
  455. '#type' => 'textfield',
  456. '#title' => t('Image path.'),
  457. '#default_value' => variable_get('user_details_loggedin_customlinkthree_imgsrc', ''),
  458. '#description' => t('the path to your image. (example: /sites/all/themes/my-theme/custom-link-three.png)'),
  459. '#size' => 75,
  460. '#maxlength' => 500,
  461. );
  462. $form['loggedin_links']['custom_link_three']['user_details_loggedin_customlinkthree_imgtitle'] = array(
  463. '#type' => 'textfield',
  464. '#title' => t('Image title.'),
  465. '#default_value' => variable_get('user_details_loggedin_customlinkthree_imgtitle', ''),
  466. '#description' => t('The image title, or mouse-over tooltip, of the image.'),
  467. '#size' => 75,
  468. '#maxlength' => 500,
  469. );
  470. //Custom Link Four Options
  471. $form['loggedin_links']['custom_link_four'] = array(
  472. '#type' => 'fieldset',
  473. '#title' => t('Custom Link Four'),
  474. '#collapsible' => 'true',
  475. '#collapsed' => 'true',
  476. );
  477. $form['loggedin_links']['custom_link_four']['user_details_loggedin_customlinkfour_type'] = array(
  478. '#type' => 'select',
  479. '#title' => t('Link Type'),
  480. '#options' => array(
  481. 0 => t('Disabled'),
  482. 2 => t('User Link'),
  483. 3 => t('Admin Link'),
  484. ),
  485. '#default_value' => variable_get('user_details_loggedin_customlinkfour_type', '0'),
  486. '#description' => t('Choose which type of link this link is.'),
  487. );
  488. $form['loggedin_links']['custom_link_four']['user_details_loggedin_customlinkfour_url'] = array(
  489. '#type' => 'textfield',
  490. '#title' => t('URL path.'),
  491. '#default_value' => variable_get('user_details_loggedin_customlinkfour_url', ''),
  492. '#description' => t('the url of the page you want this link to refer to. (example: /admin/structure/pages)'),
  493. '#size' => 75,
  494. '#maxlength' => 500,
  495. );
  496. $form['loggedin_links']['custom_link_four']['user_details_loggedin_customlinkfour_imgsrc'] = array(
  497. '#type' => 'textfield',
  498. '#title' => t('Image path.'),
  499. '#default_value' => variable_get('user_details_loggedin_customlinkfour_imgsrc', ''),
  500. '#description' => t('the path to your image. (example: /sites/all/themes/my-theme/custom-link-four.png)'),
  501. '#size' => 75,
  502. '#maxlength' => 500,
  503. );
  504. $form['loggedin_links']['custom_link_four']['user_details_loggedin_customlinkfour_imgtitle'] = array(
  505. '#type' => 'textfield',
  506. '#title' => t('Image title.'),
  507. '#default_value' => variable_get('user_details_loggedin_customlinkfour_imgtitle', ''),
  508. '#description' => t('The image title, or mouse-over tooltip, of the image.'),
  509. '#size' => 75,
  510. '#maxlength' => 500,
  511. );
  512. //Custom Link Five Options
  513. $form['loggedin_links']['custom_link_five'] = array(
  514. '#type' => 'fieldset',
  515. '#title' => t('Custom Link Five'),
  516. '#collapsible' => 'true',
  517. '#collapsed' => 'true',
  518. );
  519. $form['loggedin_links']['custom_link_five']['user_details_loggedin_customlinkfive_type'] = array(
  520. '#type' => 'select',
  521. '#title' => t('Link Type'),
  522. '#options' => array(
  523. 0 => t('Disabled'),
  524. 2 => t('User Link'),
  525. 3 => t('Admin Link'),
  526. ),
  527. '#default_value' => variable_get('user_details_loggedin_customlinkfive_type', '0'),
  528. '#description' => t('Choose which type of link this link is.'),
  529. );
  530. $form['loggedin_links']['custom_link_five']['user_details_loggedin_customlinkfive_url'] = array(
  531. '#type' => 'textfield',
  532. '#title' => t('URL path.'),
  533. '#default_value' => variable_get('user_details_loggedin_customlinkfive_url', ''),
  534. '#description' => t('the url of the page you want this link to refer to. (example: /admin/structure/pages)'),
  535. '#size' => 75,
  536. '#maxlength' => 500,
  537. );
  538. $form['loggedin_links']['custom_link_five']['user_details_loggedin_customlinkfive_imgsrc'] = array(
  539. '#type' => 'textfield',
  540. '#title' => t('Image path.'),
  541. '#default_value' => variable_get('user_details_loggedin_customlinkfive_imgsrc', ''),
  542. '#description' => t('the path to your image. (example: /sites/all/themes/my-theme/custom-link-five.png)'),
  543. '#size' => 75,
  544. '#maxlength' => 500,
  545. );
  546. $form['loggedin_links']['custom_link_five']['user_details_loggedin_customlinkfive_imgtitle'] = array(
  547. '#type' => 'textfield',
  548. '#title' => t('Image title.'),
  549. '#default_value' => variable_get('user_details_loggedin_customlinkfive_imgtitle', ''),
  550. '#description' => t('The image title, or mouse-over tooltip, of the image.'),
  551. '#size' => 75,
  552. '#maxlength' => 500,
  553. );
  554. $form['loggedin_links_hr'] = array(
  555. '#type' => 'fieldset',
  556. '#title' => 'Horizontal Ruler.',
  557. '#collapsible' => 'true',
  558. '#collapsed' => 'true',
  559. );
  560. $form['loggedin_links_hr']['user_details_loggedin_links_hr_display'] = array(
  561. '#type' => 'checkbox',
  562. '#title' => t('Display "HR"'),
  563. '#default_value' => variable_get('user_details_loggedin_links_hr_display', FALSE),
  564. '#description' => t('Displays a hortizontal ruler html enity seprating the links and content sections.'),
  565. );
  566. //Content Options
  567. $form['loggedin_content'] = array(
  568. '#type' => 'fieldset',
  569. '#title' => 'Content.',
  570. '#collapsible' => 'true',
  571. '#collapsed' => 'true',
  572. );
  573. $form['loggedin_content']['user_details_loggedin_content_display'] = array(
  574. '#type' => 'checkbox',
  575. '#title' => t('Display "Content"'),
  576. '#default_value' => variable_get('user_details_loggedin_content_display', FALSE),
  577. '#description' => t('Lists the last X updated nodes authored by the user.')
  578. );
  579. $form['loggedin_content']['user_details_loggedin_content_amount'] = array(
  580. '#type' => 'textfield',
  581. '#title' => t('User content amount'),
  582. '#default_value' => variable_get('user_details_loggedin_content_amount', 3),
  583. '#size' => 2,
  584. '#maxlength' => 2,
  585. '#description' => t('Changes the number of recent items listed for the "Content" list. (<b>if set to 0 it renders this list null.</b>)')
  586. );
  587. /**
  588. * Authored options
  589. *
  590. * the authored by block settings.
  591. */
  592. $form['authored_header'] = array(
  593. '#markup' => $authored_header,
  594. );
  595. $form['authored_stats'] = array(
  596. '#type' => 'fieldset',
  597. '#title' => 'User Stats.',
  598. '#collapsible' => 'true',
  599. '#collapsed' => 'true',
  600. );
  601. $form['authored_stats']['user_details_authored_avatar_display'] = array(
  602. '#type' => 'checkbox',
  603. '#title' => t('Display the "User Avatar".'),
  604. '#default_value' => variable_get('user_details_authored_avatar_display', FALSE),
  605. '#description' => t('Displays the Avatar of the user, if any is available.')
  606. );
  607. $form['authored_stats']['user_details_authored_joined_display'] = array(
  608. '#type' => 'checkbox',
  609. '#title' => t('Display the "Joined Date".'),
  610. '#default_value' => variable_get('user_details_authored_joined_display', FALSE),
  611. '#description' => t('Displays the account creation date of the user.')
  612. );
  613. $form['authored_stats']['user_details_authored_postcount_display'] = array(
  614. '#type' => 'checkbox',
  615. '#title' => t('Display the "Post count"'),
  616. '#default_value' => variable_get('user_details_authored_postcount_display', FALSE),
  617. '#description' => t('Displays the user\'s current number of posts.'),
  618. );
  619. if (module_exists('userpoints')) {
  620. $form['authored_stats']['user_details_authored_points_display'] = array(
  621. '#type' => 'checkbox',
  622. '#title' => t('Display the "User Points".'),
  623. '#default_value' => variable_get('user_details_authored_points_display', FALSE),
  624. '#description' => t('Displays the user\'s "User Points" amount.'),
  625. '#disabled' => FALSE,
  626. );
  627. }
  628. else {
  629. $form['authored_stats']['user_details_authored_points_display'] = array(
  630. '#type' => 'checkbox',
  631. '#title' => t('Display the "User Points".'),
  632. '#default_value' => variable_get('user_details_authored_points_display', FALSE),
  633. '#description' => t('Please install <a href="http://drupal.org/project/userpoints">User Points</a>'),
  634. '#disabled' => TRUE,
  635. );
  636. }
  637. $form['authored_stats']['user_details_authored_rank_display'] = array(
  638. '#type' => 'checkbox',
  639. '#title' => t('Display the role.'),
  640. '#default_value' => variable_get('user_details_authored_rank_display', FALSE),
  641. '#description' => t('Displays the user\'s role name.'),
  642. );
  643. $form['authored_stats_hr'] = array(
  644. '#type' => 'fieldset',
  645. '#title' => 'Horizontal Ruler.',
  646. '#collapsible' => 'true',
  647. '#collapsed' => 'true',
  648. );
  649. $form['authored_stats_hr']['user_details_authored_stats_hr_display'] = array(
  650. '#type' => 'checkbox',
  651. '#title' => t('Display "HR"'),
  652. '#default_value' => variable_get('user_details_authored_stats_hr_display', FALSE),
  653. '#description' => t('Displays a hortizontal ruler html enity seprating the stats and links sections.'),
  654. );
  655. $form['authored_links'] = array(
  656. '#type' => 'fieldset',
  657. '#title' => 'Links.',
  658. '#collapsible' => 'true',
  659. '#collapsed' => 'true',
  660. );
  661. $form['authored_links']['profile_link'] = array(
  662. '#type' => 'fieldset',
  663. '#title' => t('Profile Link'),
  664. '#collapsible' => 'true',
  665. '#collapsed' => 'true',
  666. );
  667. $form['authored_links']['profile_link']['user_details_authored_profilelink_display'] = array(
  668. '#type' => 'checkbox',
  669. '#title' => t('Display'),
  670. '#default_value' => variable_get('user_details_authored_profilelink_display', FALSE),
  671. '#description' => t('Displays an icon link leading to the user\'s profile page.'),
  672. );
  673. $form['authored_links']['profile_link']['user_details_authored_profilelink_imgsrc'] = array(
  674. '#type' => 'textfield',
  675. '#title' => t('Image source.'),
  676. '#default_value' => variable_get('user_details_authored_profilelink_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/profile-icon.png"),
  677. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/profile-icon.png</i>'),
  678. '#size' => 75,
  679. '#maxlength' => 500,
  680. );
  681. $form['authored_links']['privatemsg_link'] = array(
  682. '#type' => 'fieldset',
  683. '#title' => t('Private Message Link'),
  684. '#collapsible' => 'true',
  685. '#collapsed' => 'true',
  686. );
  687. if (module_exists('privatemsg')) {
  688. $form['authored_links']['privatemsg_link']['user_details_authored_privatemsglink_display'] = array(
  689. '#type' => 'checkbox',
  690. '#title' => t('Display'),
  691. '#default_value' => variable_get('user_details_authored_privatemsglink_display', FALSE),
  692. '#description' => t('Displays an icon link leading to the user\'s private message profile page.'),
  693. '#disabled' => FALSE,
  694. );
  695. }
  696. else {
  697. $form['authored_links']['privatemsg_link']['user_details_authored_privatemsglink_display'] = array(
  698. '#type' => 'checkbox',
  699. '#title' => t('Display'),
  700. '#default_value' => variable_get('user_details_authored_privatemsglink_display', FALSE),
  701. '#description' => t('please install <a href="http://drupal.org/project/privatemsg">Private Message</a>.'),
  702. '#disabled' => TRUE,
  703. );
  704. }
  705. if (module_exists('privatemsg')) {
  706. $form['authored_links']['privatemsg_link']['user_details_authored_privatemsglink_imgsrc'] = array(
  707. '#type' => 'textfield',
  708. '#title' => t('Image source.'),
  709. '#default_value' => variable_get('user_details_authored_privatemsg_imgsrc', "/" . drupal_get_path('module', 'user_details') . "/images/privatemsg-icon.png"),
  710. '#description' => t('default value: <i>/' . drupal_get_path('module', 'user_details') . '/images/privatemsg-icon.png</i>'),
  711. '#size' => 75,
  712. '#maxlength' => 500,
  713. );
  714. }
  715. $form['authored_links_hr'] = array(
  716. '#type' => 'fieldset',
  717. '#title' => 'Horizontal Ruler.',
  718. '#collapsible' => 'true',
  719. '#collapsed' => 'true',
  720. );
  721. $form['authored_links_hr']['user_details_authored_links_hr_display'] = array(
  722. '#type' => 'checkbox',
  723. '#title' => t('Display "HR"'),
  724. '#default_value' => variable_get('user_details_authored_links_hr_display', FALSE),
  725. '#description' => t('Displays a hortizontal ruler html enity seprating the links and content sections.'),
  726. );
  727. //Content Options
  728. $form['authored_content'] = array(
  729. '#type' => 'fieldset',
  730. '#title' => 'Content.',
  731. '#collapsible' => 'true',
  732. '#collapsed' => 'true',
  733. );
  734. $form['authored_content']['user_details_authored_content_display'] = array(
  735. '#type' => 'checkbox',
  736. '#title' => t('Display "Content"'),
  737. '#default_value' => variable_get('user_details_authored_content_display', FALSE),
  738. '#description' => t('Lists the last X updated nodes authored by the user.')
  739. );
  740. $form['authored_content']['user_details_authored_content_amount'] = array(
  741. '#type' => 'textfield',
  742. '#title' => t('User content amount'),
  743. '#default_value' => variable_get('user_details_authored_content_amount', 3),
  744. '#size' => 2,
  745. '#maxlength' => 2,
  746. '#description' => t('Changes the number of recent items listed for the "Content" list. (<b>if set to 0 it renders this list null.</b>)')
  747. );
  748. return system_settings_form($form);
  749. }
  750. ?>