示例#1
0
文件: Zalgo.php 项目: mdwheele/zalgo
 protected function disturb()
 {
     $soul = $this->soul->harvest();
     $levels = $this->mood->getDisturbenceLevels();
     foreach (array_keys($levels) as $direction) {
         for ($i = 0; $i < $levels[$direction]; $i++) {
             $this->whisper .= $soul[$direction][rand(0, count($soul[$direction]) - 1)];
         }
     }
 }
示例#2
0
 /**
  * Render the Stylesheet
  *
  * @param \DOMDocument $domDocument DOMDocument for which the Stylesheet should be rendered
  * @return \DOMElement
  */
 public function render(\DOMDocument $domDocument)
 {
     $stylesheetXml = $domDocument->createElement("stylesheet");
     if ($this->styles3d) {
         $stylesXml = $domDocument->createElement("frame3dstyles");
         $stylesheetXml->appendChild($stylesXml);
         foreach ($this->styles3d as $style3d) {
             $style3dXml = $style3d->render($domDocument);
             $stylesXml->appendChild($style3dXml);
         }
     }
     if ($this->mood) {
         $moodXml = $this->mood->render($domDocument);
         $stylesheetXml->appendChild($moodXml);
     }
     return $stylesheetXml;
 }
 public function moods()
 {
     return $this->moods = Mood::averageMoodTypePerFeelingArray($this->feelingID);
 }
示例#4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMoods()
 {
     return $this->hasMany(Mood::className(), ['user_id' => 'id']);
 }
示例#5
0
<?php

header("Access-Control-Allow-Origin:*");
require_once '../../public/config/config.php';
require_once '../../class/mood.class.php';
$newMood = new Mood();
$controller = @$_GET['controller'];
switch ($controller) {
    case 'GetMoodByPage':
        $page = $_GET['page'];
        echo json_encode($newMood->GetMoodByPage($page));
        break;
    case 'DelMood':
        echo $newMood->DelMood();
        break;
    case 'SaveMood':
        echo $newMood->SaveMood();
        break;
        // case '':
        // 	break;
        // case '':
        // 	break;
    // case '':
    // 	break;
    // case '':
    // 	break;
    default:
        echo -2;
        break;
}