예제 #1
0
 private function dig($bodyPart)
 {
     $bodyLines = explode(PHP_EOL, trim($bodyPart));
     $headerLines = $this->parseHeader($bodyLines);
     if (array_key_exists('content-type', $headerLines)) {
         $bp = new BodyPart();
         $_bodies = self::parseBody($bodyLines, $headerLines['content-type']);
         $bp->setBody($_bodies);
         if (sizeof($_bodies) > 1) {
             foreach ($_bodies as $_body) {
                 self::dig($_body);
             }
         } else {
             $bp->setHeader($headerLines);
             // Is it a attachement?
             if (array_key_exists('content-disposition', $headerLines)) {
                 array_push($this->contentDispos, trim($headerLines['content-disposition']));
                 $a = new Attachement();
                 preg_match('!filename=(.*)$!mi', $headerLines['content-disposition'], $matches);
                 $filename = str_replace(array("'", '"'), '', trim($matches[1]));
                 $a->setFilename($filename);
                 $a->setContent(self::makeBody($bp));
                 $a->setContentType($headerLines['content-type']);
                 array_push($this->attachements, $a);
             } else {
                 // or just a embedded object?
                 if (array_key_exists('content-id', $headerLines)) {
                     array_push($this->contentIds, trim($headerLines['content-id']));
                     $a = new Attachement();
                     // Create the filename from the cid:
                     $filename = self::sanitizeFileName($headerLines['content-id']);
                     // The content type string often holds more data than just the mime type
                     $ct = $headerLines['content-type'];
                     if (strpos($ct, ';')) {
                         $_ct = explode(';', $ct);
                         $filename .= '.' . explode('/', $_ct[0])[1];
                     } else {
                         $filename .= '.' . explode('/', $ct)[1];
                     }
                     if (self::DEBUG || self::TRACE) {
                         printf("[" . date(DATE_RFC822) . "] Filename is: %s" . PHP_EOL, $filename);
                     }
                     $a->setFilename($filename);
                     $a->setContent(self::makeBody($bp));
                     $a->setContentType($ct);
                     array_push($this->attachements, $a);
                 }
             }
             array_push($this->allBodyParts, $bp);
         }
     }
 }
예제 #2
0
파일: site.php 프로젝트: jasonhai/onehome
            <ul class="link">
                <li class="twitter"><a href="https://twitter.com/#!/65doctor" target="_bank"><?php 
echo Yii::t('translation', 'layout.site.Follow_us_on_Twitter');
?>
</a></li>
            	<li><a href="https://www.facebook.com/pages/65doctor/267042123402667" target="_bank"><?php 
echo Yii::t('translation', 'layout.site.Find_us_on_Facebook');
?>
</a></li>
            </ul>
        </div>
    </header><!-- //header -->
     <?php 
$specialty = Specialty::model()->findAll(array('order' => 'first_char ASC'));
$banner = Banners::model()->findAll(array('order' => 'RAND()', 'limit' => '1'));
$body_part = BodyPart::model()->findAll(array('condition' => 'parent_id IS NULL'));
Yii::app()->clientScript->registerScript('search', "\n        \$('#search_submit').click(function(){\n            if( \$('#specialty').val()=='' && \$('#doctor_clinic').val() == ''){\n                alert('" . Yii::t('translation', 'layout.site.Please_choose_Specialty_OR_type_Doctor_name_to_search_for_doctor') . "');\n                return false;\n            }\n        });\n    ");
?>
    <div class="banner">
    	<div class="wrapper">
        	<div class="search-form">
                <p class="title"><strong><?php 
echo Yii::t('translation', 'layout.site.It_s_FREE');
?>
</strong></p>
                <?php 
echo CHtml::form(Yii::app()->createAbsoluteUrl('/search/index/'), 'get', array('id' => 'search-form', 'class' => 'jNice'));
?>
                	<input type="hidden" name="find-doctor" value="1" />
                    <fieldset>
                        <p class="type"><?php