コード例 #1
0
    echo $this->formLabel('contribution-public', __('Publish my contribution on the web.'));
    ?>
                </div>
                <div class="inputs hidden"> <!--EB: add hidden class-->
                    <?php 
    $anonymous = 0;
    ?>
                    <?php 
    echo $this->formCheckbox('contribution-anonymous', $anonymous, null, array(1, 0));
    ?>
                    <?php 
    echo $this->formLabel('contribution-anonymous', __("Contribute anonymously."));
    ?>
                </div>
                <p><?php 
    echo __("In order to contribute, you must read and agree to the %s", "<a href='" . contribution_contribute_url('terms') . "' target='_blank'>" . __('Terms and Conditions') . ".</a>");
    ?>
</p>
                <div class="inputs">
                    <?php 
    $agree = isset($_POST['terms-agree']) ? $_POST['terms-agree'] : 0;
    ?>
                    <?php 
    echo $this->formCheckbox('terms-agree', $agree, null, array('1', '0'));
    ?>
                    <!--EB: replace terms description-->
                    <?php 
    echo html_entity_decode($this->formLabel('terms-agree', 'I am over the age of 18 and have read and agree to the <a href="' . url('submission-agreement') . '" target="_blank">Submission Agreement</a>. Or, I am an educator submitting work produced by my students and I have read and agreed to the Submission Agreement and have collected the <a href="' . img('CoG-parental-consent-form.pdf') . '" target="_blank">Parental Permission Slips</a> for my own records that allow my students to participate in this project.'));
    ?>
                </div>
                <?php 
コード例 #2
0
 public function filterGuestUserWidgets($widgets)
 {
     $user = current_user();
     $widget = array('label' => __('My Contributions'));
     $contributedItems = get_db()->getTable('ContributionContributedItem')->findBy(array('contributor' => $user->id), 5);
     if ($contributedItems) {
         $html = "<ul>";
         foreach ($contributedItems as $contributedItem) {
             $item = $contributedItem->Item;
             $html .= sprintf("<li>%s</li>", link_to($item, 'show', metadata($item, array('Dublin Core', 'Title'))));
         }
         $html .= "</ul>";
         $html .= sprintf('<a href="%s">%s</a>', contribution_contribute_url('my-contributions'), __('See all my contributions'));
     } else {
         $html = '<p>' . __('No contribution yet.') . '</p>';
     }
     $widget['content'] = $html;
     $widgets[] = $widget;
     return $widgets;
 }
コード例 #3
0
/**
 * Get a link to the public contribution page.
 *
 * @param string $linkText
 * @param string $action Action to link to, main index if none.
 * @return string HTML
 */
function contribution_link_to_contribute($linkText = 'Contribute', $actionName = null)
{
    $url = contribution_contribute_url($actionName);
    return "<a href=\"{$url}\">{$linkText}</a>";
}