/**
 *
 *
 * @param string $displayAs
 * @return string
 */
function displayAsSymbol($displayAs)
{
    switch (strtolower($displayAs)) {
        case 'heading':
            return symbol('heading');
        case 'categories':
            return symbol('nested');
        case 'flat':
            return symbol('flat');
        case 'discussions':
        default:
            return symbol('discussions');
    }
}
Beispiel #2
0
 static function parseArguments($source = null, $fpos = 0)
 {
     $parser = new ArgumentLexer($source, $fpos);
     $result = array();
     $current_buffer =& $result;
     $filter_buffer = array();
     $tokens = $parser->parse();
     foreach ($tokens as $token) {
         list($token, $data) = $token;
         if ($token == 'filter_start') {
             $filter_buffer = array();
             $current_buffer =& $filter_buffer;
         } elseif ($token == 'filter_end') {
             if (count($filter_buffer)) {
                 $i = count($result) - 1;
                 if (is_array($result[$i])) {
                     $result[$i]['filters'][] = $filter_buffer;
                 } else {
                     $result[$i] = array(0 => $result[$i], 'filters' => array($filter_buffer));
                 }
             }
             $current_buffer =& $result;
         } elseif ($token == 'boolean') {
             $current_buffer[] = $data === 'true' ? true : false;
         } elseif ($token == 'name') {
             $current_buffer[] = symbol($data);
         } elseif ($token == 'number' || $token == 'string') {
             $current_buffer[] = $data;
         } elseif ($token == 'named_argument') {
             $last = $current_buffer[count($current_buffer) - 1];
             if (!is_array($last)) {
                 $current_buffer[] = array();
             }
             $namedArgs =& $current_buffer[count($current_buffer) - 1];
             list($name, $value) = array_map('trim', explode(':', $data, 2));
             # if argument value is variable mark it
             $value = self::parseArguments($value);
             $namedArgs[$name] = $value[0];
         } elseif ($token == 'operator') {
             $current_buffer[] = array('operator' => $data);
         }
     }
     return $result;
 }
Beispiel #3
0
function compile_call($expr, &$oob)
{
    static $php_forms = array("print", "array");
    $name = array_shift($expr);
    $oob["macros"] = is_array($oob["macros"]) ? $oob["macros"] : array();
    if (array_key_exists(symbol_str($name), $oob["macros"])) {
        array_unshift($expr, $oob["macros"][$name . ""]);
        return compile(call_user_func_array("call", $expr), $oob);
    }
    $buf = ",";
    foreach ($expr as $e) {
        $buf .= compile(is_symbol($e) ? array(symbol("env"), $e) : $e, $oob) . ",";
    }
    $buf = substr($buf, 0, -1);
    $buf = $buf == "," ? "" : $buf;
    if (function_exists($name . "") or in_array($name . "", $php_forms)) {
        return "" . $name . "(" . substr($buf, 1, strlen($buf)) . ")";
    }
    return "call(" . compile($name, $oob) . $buf . ")";
}
Beispiel #4
0
 function render($context, $stream)
 {
     if ($this->argument) {
         $object = $context->resolve(symbol($this->argument));
     } else {
         $object = $context->scopes[0];
     }
     $output = "<pre>" . print_r($object, true) . "</pre>";
     $stream->write($output);
 }
Beispiel #5
0
        echo symbol_bool($profile->is_disp_regist);
        ?>
</td>
	<td><?php 
        echo symbol_bool($profile->is_disp_config);
        ?>
</td>
	<td><?php 
        echo symbol_bool($profile->is_disp_search);
        ?>
</td>
	<td><?php 
        if (in_array($profile->form_type, Site_Profile::get_form_types_having_profile_options())) {
            echo Html::anchor('admin/profile/options/' . $profile->id, term('site.list'));
        } else {
            echo symbol('noValue');
        }
        ?>
</td>
</tr>
<?php 
    }
    ?>
</table>
<?php 
} else {
    echo term('profile', 'site.item');
    ?>
がありません。
<?php 
}
Beispiel #6
0
 /**
  * Apply markup rules on plain text.
  *
  * @param TextFormat $markup  Markup rules applied on marked-up text.
  * @param string     $text    Marked-up text on which rules are applied.
  *
  * @return string  HTML code computed from marked-up text.
  */
 private static function markupText($markup, $text)
 {
     return symbol(smile($markup->format($text), false));
 }
Beispiel #7
0
 static function macro_expand($form)
 {
     if (is_array($form)) {
         $output = array();
         foreach ($form as $part) {
             if (is_array($part)) {
                 array_push($output, self::macro_expand($part));
             } else {
                 array_push($output, $part);
             }
         }
         $op = $output[0];
         if (is_symbol($op) and substr($op . "", -1) == "." and $op . "" != ".") {
             $output[0] = symbol(substr($op, 0, strlen($op) - 1));
             $op = symbol("new");
             array_unshift($output, $op);
         }
         if (is_symbol($op) and $op->macro) {
             $op = Lisp::eval1($op);
             array_shift($output);
             $output = Lisp::apply1($op, $output);
             $output = self::macro_expand($output);
         }
         return $output;
     } else {
         return $form;
     }
 }
Beispiel #8
0
 static function parseArguments($source = null, $fpos = 0)
 {
     $parser = new ArgumentLexer($source, $fpos);
     $result = array();
     $current_buffer =& $result;
     $filter_buffer = array();
     foreach ($parser->parse() as $token) {
         list($token, $data) = $token;
         if ($token == 'filter_start') {
             $filter_buffer = array();
             $current_buffer =& $filter_buffer;
         } elseif ($token == 'filter_end') {
             if (count($filter_buffer)) {
                 $result[] = $filter_buffer;
             }
             $current_buffer =& $result;
         } elseif ($token == 'name') {
             $current_buffer[] = symbol($data);
         } elseif ($token == 'number' || $token == 'string') {
             $current_buffer[] = $data;
         } elseif ($token == 'named_argument') {
             $last = $current_buffer[count($current_buffer) - 1];
             if (!is_array($last)) {
                 $current_buffer[] = array();
             }
             $namedArgs =& $current_buffer[count($current_buffer) - 1];
             list($name, $value) = array_map('trim', explode(':', $data, 2));
             $namedArgs[$name] = $value;
         } elseif ($token == 'operator') {
             $current_buffer[] = array('operator' => $data);
         }
     }
     return $result;
 }
Beispiel #9
0
 public function render($context, $stream)
 {
     if ($this->argument) {
         $object = $context->resolve(symbol($this->argument));
     } else {
         $object = $context->scopes[0];
     }
     $output = '<pre>' . htmlspecialchars(print_r($object, true)) . '</pre>';
     $stream->write($output);
 }
Beispiel #10
0
function symbol_bool($bool)
{
    return $bool ? symbol('bool.true') : symbol('bool.false');
}
Beispiel #11
0
        $Result1 = mysqli_fetch_array($strSQL1);
        echo $Result1['question'];
        ?>
</td>
	<td><?php 
        echo $Result['answer'];
        ?>
</td>
	<td><?php 
        echo $Result['c_answer'];
        ?>
</td>
   
    
	<td> <div align="center">  <span class='<?php 
        symbol($Result['mark']);
        ?>
' aria-hidden="true"></span> </div></td>
  </tr>
  <?php 
    }
    ?>
  </tbody>
</table>



<div class="footer-copyright" align="center">
	<div class="container">
		<div class="span 12">
				
Beispiel #12
0
        } else {
            ?>
	<td class="small"><?php 
            echo symbol('noValue');
            ?>
</td>
<?php 
        }
        ?>

	<td><?php 
        echo Html::anchor('admin/member/' . $member->id, $member->name);
        ?>
</td>
	<td><?php 
        echo isset($member->sex) && strlen($member->sex) ? \Site_Form::get_form_options4config('term.member.sex.options', $member->sex) : symbol('noValue');
        ?>
</td>
	<td class="fs12"><?php 
        echo site_get_time($member->created_at, 'relative', 'Y/m/d H:i');
        ?>
</td>
	<td class="fs12"><?php 
        echo site_get_time($member->last_login, 'relative', 'Y/m/d H:i');
        ?>
</td>
</tr>
<?php 
    }
    ?>
</table>