コード例 #1
0
 function _formatBible($raw, $linked = FALSE)
 {
     if ($raw) {
         $br = new Bible_Ref($raw);
         return $linked ? $br->getLinkedShortString() : $br->toShortString();
     }
     return '';
 }
コード例 #2
0
ファイル: service.class.php プロジェクト: vanoudt/jethro-pmm
 function printFieldValue($fieldname)
 {
     // a few special cases
     switch ($fieldname) {
         case 'bible_to_read':
         case 'bible_to_preach':
             $type = substr($fieldname, strlen('bible_to_'));
             $readings = $this->getRawBibleReadings($type);
             $res = array();
             foreach ($readings as $reading) {
                 $br = new Bible_Ref($reading['bible_ref']);
                 $res[] = $br->getLinkedShortString();
             }
             echo implode(', ', $res);
             break;
         case 'bible_all':
             $readings = $this->getRawBibleReadings();
             $res = array();
             foreach ($readings as $reading) {
                 $br = new Bible_Ref($reading['bible_ref']);
                 $entry = $br->getLinkedShortString();
                 if (!$reading['to_read']) {
                     $entry = '(' . $entry . ')';
                 }
                 if ($reading['to_preach']) {
                     $entry = '<strong>' . $entry . '</strong>';
                 }
                 $res[] = $entry;
             }
             echo implode(', ', $res);
             break;
         case 'format_title':
         case 'topic_title':
             echo ents($this->values[$fieldname]);
             break;
         case 'summary':
         case 'summary_inline':
             $separator = $fieldname == 'summary' ? '<br />' : '&nbsp; &bull; &nbsp;';
             $bits = array();
             if (strlen($this->values['topic_title'])) {
                 $bits[] = '<i>' . ents($this->values['topic_title']) . '</i>';
             }
             if ($this->getRawBibleReadings()) {
                 ob_start();
                 $this->printFieldValue('bible_all');
                 $bits[] = ob_get_clean();
             }
             if (strlen($this->values['format_title'])) {
                 $bits[] = ents($this->values['format_title']);
             }
             if (!empty($this->values['notes'])) {
                 $x = '<small>';
                 if ($fieldname == 'summary_inline') {
                     $x .= str_replace("\n", ' / ', ents($this->values['notes']));
                 } else {
                     $x .= nl2br(ents($this->values['notes']));
                 }
                 $x .= '</small>';
                 $bits[] = $x;
             }
             echo implode($separator, $bits);
             break;
         default:
             if (strpos($fieldname, 'comps_') === 0) {
                 $compCatID = (int) substr($fieldname, 6);
                 $res = array();
                 foreach ($this->getItems(FALSE, $compCatID) as $item) {
                     $res[] = ents($item['title']);
                 }
                 echo implode('<br />', $res);
             } else {
                 parent::printFieldvalue($fieldname);
             }
     }
 }
コード例 #3
0
ファイル: service.class.php プロジェクト: samrae/jethro-pmm
    function printFieldValue($fieldname)
    {
        // a few special cases
        switch ($fieldname) {
            case 'bible_to_read':
            case 'bible_to_preach':
                $type = substr($fieldname, strlen('bible_to_'));
                $readings = $this->getRawBibleReadings('read');
                $res = array();
                foreach ($readings as $reading) {
                    $br = new Bible_Ref($reading['bible_ref']);
                    $res[] = $br->getLinkedShortString();
                }
                echo implode(', ', $res);
                break;
            case 'bible_all':
                $readings = $this->getRawBibleReadings();
                $res = array();
                foreach ($readings as $reading) {
                    $br = new Bible_Ref($reading['bible_ref']);
                    $entry = $br->getLinkedShortString();
                    if (!$reading['to_read']) {
                        $entry = '(' . $entry . ')';
                    }
                    if ($reading['to_preach']) {
                        $entry = '<strong>' . $entry . '</strong>';
                    }
                    $res[] = $entry;
                }
                echo implode(', ', $res);
                break;
            case 'format_title':
            case 'topic_title':
                echo ents($this->values[$fieldname]);
                break;
            case 'summary':
                ?>
				<i><?php 
                echo ents($this->values['topic_title']);
                ?>
</i><br />
				<?php 
                $this->printFieldValue('bible_all');
                ?>
<br />
				<?php 
                echo ents($this->values['format_title']);
                if (!empty($this->values['notes'])) {
                    ?>
					&nbsp;<span class="clickable" onclick="$(this).next('div.hide').toggle()"><i class="icon-chevron-down"></i></span>
					<div class="smallprint hide"><?php 
                    echo nl2br(ents($this->values['notes']));
                    ?>
</div>
					<?php 
                }
                break;
            default:
                if (strpos($fieldname, 'comps_') === 0) {
                    $compCatID = (int) substr($fieldname, 6);
                    $res = array();
                    foreach ($this->getItems(FALSE, $compCatID) as $item) {
                        $res[] = ents($item['title']);
                    }
                    echo implode('<br />', $res);
                } else {
                    parent::printFieldvalue($fieldname);
                }
        }
    }
コード例 #4
0
    function printFieldValue($fieldname)
    {
        // a few special cases
        switch ($fieldname) {
            case 'bible_to_read':
            case 'bible_to_preach':
                $type = substr($fieldname, strlen('bible_to_'));
                $readings = $this->getRawBibleReadings($type);
                $res = array();
                foreach ($readings as $reading) {
                    $br = new Bible_Ref($reading['bible_ref']);
                    $res[] = $br->getLinkedShortString();
                }
                echo implode(', ', $res);
                break;
            case 'bible_all':
                $readings = $this->getRawBibleReadings();
                $res = array();
                foreach ($readings as $reading) {
                    $br = new Bible_Ref($reading['bible_ref']);
                    $entry = $br->getLinkedShortString();
                    if (!$reading['to_read']) {
                        $entry = '(' . $entry . ')';
                    }
                    if ($reading['to_preach']) {
                        $entry = '<strong>' . $entry . '</strong>';
                    }
                    $res[] = $entry;
                }
                echo implode(', ', $res);
                break;
            case 'format_title':
            case 'topic_title':
                echo ents($this->values[$fieldname]);
                break;
            case 'summary':
            case 'summary_inline':
                $separator = $fieldname == 'summary' ? '<br />' : '&nbsp; &bull; &nbsp;';
                ?>
				<i><?php 
                echo ents($this->values['topic_title']);
                ?>
</i>
				<?php 
                if ($this->getRawBibleReadings()) {
                    echo $separator;
                    $this->printFieldValue('bible_all');
                }
                if (strlen($this->values['format_title'])) {
                    echo $separator . ents($this->values['format_title']);
                }
                if (!empty($this->values['notes'])) {
                    echo $separator;
                    echo '<small>';
                    if ($fieldname == 'summary_inline') {
                        echo str_replace("\n", ' / ', ents($this->values['notes']));
                    } else {
                        echo nl2br(ents($this->values['notes']));
                    }
                    echo '</small>';
                    // 					&nbsp;<span class="clickable" data-toggle="visible" data-target="next"><i class="icon-chevron-down"></i></span>
                    //	<div class="smallprint "><?php echo ; </div>
                }
                break;
            default:
                if (strpos($fieldname, 'comps_') === 0) {
                    $compCatID = (int) substr($fieldname, 6);
                    $res = array();
                    foreach ($this->getItems(FALSE, $compCatID) as $item) {
                        $res[] = ents($item['title']);
                    }
                    echo implode('<br />', $res);
                } else {
                    parent::printFieldvalue($fieldname);
                }
        }
    }