PageRenderTime 48ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/themes/bartik/templates/node--add_item.tpl.php

https://bitbucket.org/hjain/trinet
PHP | 135 lines | 42 code | 10 blank | 83 comment | 6 complexity | 3b43cd3cd7cfd47e63d850567eb5f733 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0, AGPL-1.0
  1. <?php
  2. //echo "<pre>"; print_r($node);exit;
  3. /**
  4. * @file
  5. * Bartik's theme implementation to display a node.
  6. *
  7. * Available variables:
  8. * - $title: the (sanitized) title of the node.
  9. * - $content: An array of node items. Use render($content) to print them all,
  10. * or print a subset such as render($content['field_example']). Use
  11. * hide($content['field_example']) to temporarily suppress the printing of a
  12. * given element.
  13. * - $user_picture: The node author's picture from user-picture.tpl.php.
  14. * - $date: Formatted creation date. Preprocess functions can reformat it by
  15. * calling format_date() with the desired parameters on the $created variable.
  16. * - $name: Themed username of node author output from theme_username().
  17. * - $node_url: Direct url of the current node.
  18. * - $display_submitted: Whether submission information should be displayed.
  19. * - $submitted: Submission information created from $name and $date during
  20. * template_preprocess_node().
  21. * - $classes: String of classes that can be used to style contextually through
  22. * CSS. It can be manipulated through the variable $classes_array from
  23. * preprocess functions. The default values can be one or more of the
  24. * following:
  25. * - node: The current template type, i.e., "theming hook".
  26. * - node-[type]: The current node type. For example, if the node is a
  27. * "Blog entry" it would result in "node-blog". Note that the machine
  28. * name will often be in a short form of the human readable label.
  29. * - node-teaser: Nodes in teaser form.
  30. * - node-preview: Nodes in preview mode.
  31. * The following are controlled through the node publishing options.
  32. * - node-promoted: Nodes promoted to the front page.
  33. * - node-sticky: Nodes ordered above other non-sticky nodes in teaser
  34. * listings.
  35. * - node-unpublished: Unpublished nodes visible only to administrators.
  36. * - $title_prefix (array): An array containing additional output populated by
  37. * modules, intended to be displayed in front of the main title tag that
  38. * appears in the template.
  39. * - $title_suffix (array): An array containing additional output populated by
  40. * modules, intended to be displayed after the main title tag that appears in
  41. * the template.
  42. *
  43. * Other variables:
  44. * - $node: Full node object. Contains data that may not be safe.
  45. * - $type: Node type, i.e. story, page, blog, etc.
  46. * - $comment_count: Number of comments attached to the node.
  47. * - $uid: User ID of the node author.
  48. * - $created: Time the node was published formatted in Unix timestamp.
  49. * - $classes_array: Array of html class attribute values. It is flattened
  50. * into a string within the variable $classes.
  51. * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
  52. * teaser listings.
  53. * - $id: Position of the node. Increments each time it's output.
  54. *
  55. * Node status variables:
  56. * - $view_mode: View mode, e.g. 'full', 'teaser'...
  57. * - $teaser: Flag for the teaser state (shortcut for $view_mode == 'teaser').
  58. * - $page: Flag for the full page state.
  59. * - $promote: Flag for front page promotion state.
  60. * - $sticky: Flags for sticky post setting.
  61. * - $status: Flag for published status.
  62. * - $comment: State of comment settings for the node.
  63. * - $readmore: Flags true if the teaser content of the node cannot hold the
  64. * main body content.
  65. * - $is_front: Flags true when presented in the front page.
  66. * - $logged_in: Flags true when the current user is a logged-in member.
  67. * - $is_admin: Flags true when the current user is an administrator.
  68. *
  69. * Field variables: for each field instance attached to the node a corresponding
  70. * variable is defined, e.g. $node->body becomes $body. When needing to access
  71. * a field's raw values, developers/themers are strongly encouraged to use these
  72. * variables. Otherwise they will have to explicitly specify the desired field
  73. * language, e.g. $node->body['en'], thus overriding any language negotiation
  74. * rule that was previously applied.
  75. *<div><br/><a href="<?php echo base_path(); ?>node/add/reply-to-post">Reply</a></div>
  76. * @see template_preprocess()
  77. * @see template_preprocess_node()
  78. * @see template_process()
  79. *<?php echo'<pre>';print_r($user->name) ; exit;?>
  80. */
  81. ?>
  82. <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  83. <?php print render($title_prefix); ?>
  84. <?php if (!$page): ?>
  85. <h2<?php print $title_attributes; ?>>
  86. <a href="<?php print $node_url; ?>"><?php print $title; ?></a>
  87. </h2>
  88. <?php endif; ?>
  89. <?php print render($title_suffix); ?>
  90. <?php if ($display_submitted): ?>
  91. <div class="meta submitted">
  92. <?php print $user_picture; ?>
  93. <?php print $submitted; ?>
  94. </div>
  95. <?php endif; ?>
  96. <div class="content clearfix"<?php print $content_attributes; ?>>
  97. <?php
  98. // We hide the comments and links now so that we can render them later.
  99. hide($content['comments']);
  100. hide($content['links']);
  101. print render($content);
  102. ?>
  103. </div>
  104. <?php
  105. // Remove the "Add new comment" link on the teaser page or if the comment
  106. // form is being displayed on the same page.
  107. if ($teaser || !empty($content['comments']['comment_form'])) {
  108. unset($content['links']['comment']['#links']['comment-add']);
  109. }
  110. // Only display the wrapper div if there are links.
  111. $links = render($content['links']);
  112. if ($links):
  113. ?>
  114. <div class="link-wrapper">
  115. <?php print $links; ?>
  116. </div>
  117. <?php endif; ?>
  118. <?php print render($content['comments']); ?>
  119. </div>
  120. <div>
  121. <?php if(($user->name!=$node->name)): ?>
  122. <form><input type="button" value="Click Here To Reply" onClick="window.location.href='<?php echo base_path(); ?>node/add/reply-to-post'"></form>
  123. <!--<div><br/><a href="<?php echo base_path(); ?>node/add/reply-to-post">Reply</a></div>-->
  124. <?php endif; ?>
  125. </div>