Ejemplo n.º 1
0
function link_to_user_interested($user, $question)
{
    if ($user->isAuthenticated()) {
        $interested = InterestPeer::retrieveByPk($question->getId(), $user->getSubscriberId());
        if ($interested) {
            // already interested
            return __('interested!');
        } else {
            // didn't declare interest yet
            return link_to_remote(__('interested?'), array('url' => 'user/interested?id=' . $question->getId(), 'update' => array('success' => 'block_' . $question->getId()), 'loading' => "Element.show('indicator')", 'complete' => "Element.hide('indicator');" . visual_effect('pulsate', 'mark_' . $question->getId())));
        }
    } else {
        return link_to_login(__('interested?'));
    }
}
Ejemplo n.º 2
0
function link_to_report_answer($answer, $user)
{
    use_helper('Javascript');
    $text = '[' . __('report to moderator') . ']';
    if ($user->isAuthenticated()) {
        $has_already_reported_answer = ReportAnswerPeer::retrieveByPk($answer->getId(), $user->getSubscriberId());
        if ($has_already_reported_answer) {
            // already spam for this user
            return '[' . __('reported as spam') . ']';
        } else {
            return link_to_remote($text, array('url' => '@user_report_answer?id=' . $answer->getId(), 'update' => array('success' => 'report_answer_' . $answer->getId()), 'loading' => "Element.show('indicator')", 'complete' => "Element.hide('indicator');" . visual_effect('highlight', 'report_answer_' . $answer->getId())));
        }
    } else {
        return link_to_login($text);
    }
}
Ejemplo n.º 3
0
      <div style="display: inline; float: left">
      <?php 
if ($sf_user->isAuthenticated()) {
    ?>
        <?php 
    echo $sf_user->getNickname();
    ?>
      <?php 
} else {
    ?>
        <?php 
    echo __('anonymous coward');
    ?>
&nbsp;
        <?php 
    echo link_to_login('[' . __('login') . ']');
    ?>
      <?php 
}
?>
      </div>
      <br class="clearleft" />

      <label for="body"><?php 
echo __('your answer:');
?>
</label>
      <?php 
echo textarea_tag('body', $sf_params->get('body'), 'size=40x10');
?>
      <br class="clearleft" />
Ejemplo n.º 4
0
<?php

use_helper('Global');
?>

<div id="add_question">
  <?php 
echo link_to_login(__('ask a new question'), '@add_question');
?>
</div>

<h2><?php 
echo __('popular tags');
?>
</h2>
<?php 
echo include_partial('tag/tag_cloud', array('tags' => QuestionTagPeer::getPopularTags(20)));
?>
<div class="right" style="padding-top: 5px"><?php 
echo link_to(__('more popular tags') . ' &raquo;', '@popular_tags');
?>
</div>

<h2><?php 
echo __('find it');
?>
</h2>
<?php 
echo include_partial('question/search');
?>