function write_role($role)
            {
                global $wp_roles;
                $role_names = $wp_roles->get_names();
                ?>
                <role>
                    <name><?php 
                echo cdata($role->name);
                ?>
</name>
                    <display_name><?php 
                echo cdata($role_names[$role->name]);
                ?>
</display_name>
                    <capabilities>
                        <?php 
                foreach ($role->capabilities as $cap => $value) {
                    ?>
                            <capability>
                                <name><?php 
                    echo cdata($cap);
                    ?>
</name>
                                <value><?php 
                    echo $value;
                    ?>
</value>
                            </capability>
                            <?php 
                }
                ?>
                    </capabilities>
                </role>
                <?php 
            }
Пример #2
0
 public function detail($id)
 {
     $arr = array();
     $xml = '<?xml version="1.0" encoding="utf-8"?>';
     $xml .= '<paras>';
     $xml .= '<IdentityGuid>Epoint_WebSerivce_**##0601</IdentityGuid>';
     $xml .= '<CaseGuid>' . $id . '</CaseGuid>';
     $xml .= '</paras>';
     $cilentOptions = array('trace' => true, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_NONE);
     $client = new SoapClient(WEB_URL, $cilentOptions);
     $ret_str = $client->SelectCaseInfoDetail(array('xmlCaseInfo' => $xml));
     //var_dump($ret_str);exit();
     $ret_str = $ret_str->SelectCaseInfoDetailResult;
     $ret_str = xml2Array($ret_str);
     //hg_pre($ret_str);exit();
     if (!$ret_str['DATA']['ReturnInfo']['Status']) {
         return $arr;
     }
     $data = $ret_str['DATA']['UserArea'];
     //hg_pre($data);exit();
     $arr['id'] = $data['CaseGuid'];
     $arr['CaseSerial'] = $data['CaseSerial'];
     $arr['create_time'] = strtotime($data['RequestDate']);
     $arr['tel'] = $data['RequestNumber'];
     $arr['user_name'] = $data['RequestPerson'];
     $arr['email'] = $data['Email'];
     $arr['address'] = $data['Address'];
     $arr['area'] = $this->settings['service_area'][$data['RequestAddress']];
     $arr['title'] = $data['RequestTitle'];
     $arr['content'] = cdata($data['Description']);
     $arr['note'] = $data['RequestNote'];
     //备注
     $arr['case_status'] = $this->settings['service_case_status'][$data['CaseStatus']];
     //工单状态
     $arr['case_type'] = $this->settings['service_case_type'][$data['CaseType']];
     //工单类型
     $arr['answer_date'] = strtotime($data['AnswerDate']);
     $arr['answer_content'] = cdata($data['AnswerContent']);
     $arr['manyidu'] = $data['ManYiDu'];
     return $arr;
 }
Пример #3
0
    $status = 0;
}
function cdata($parser, $data)
{
    global $status, $files;
    if ($status) {
        $data = preg_replace('#\\s+#', ' ', $data);
        $files[sizeof($files) - 1]["title"] .= $data;
    }
}
function parse($xraifile)
{
    $xml_parser = xml_parser_create();
    xml_set_element_handler($xml_parser, "startElement", "endElement");
    xml_set_character_data_handler($xml_parser, "cdata");
    xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false);
    if (!($fp = fopen("{$xraifile}", "r"))) {
        die("could not open XML input");
    }
    while ($data = fread($fp, 4096)) {
        if (!xml_parse($xml_parser, $data, feof($fp))) {
            die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)));
        }
    }
    xml_parser_free($xml_parser);
}
$currentdir = $basedir;
print "Processing {$xrai}\n";
startElement(null, "subcollection", array());
cdata(null, $title);
endElement(null, "subcollection");
Пример #4
0
function MG_getItems()
{
    global $MG_albums, $_TABLES, $_MG_CONF;
    $retval = '';
    if (isset($_GET['aid'])) {
        $aid = COM_applyFilter($_GET['aid'], true);
    } else {
        $aid = 0;
    }
    if (isset($_GET['src'])) {
        $src = COM_applyFilter($_GET['src']);
    } else {
        $src = 'tn';
    }
    if (isset($_GET['type'])) {
        $type = COM_applyFilter($_GET['type']);
    } else {
        $type = 'mini';
    }
    if ($src != 'disp' && $src != 'orig') {
        $src = 'tn';
    }
    if ($type != 'full' || $type != 'mini') {
        $type = 'mini';
    }
    if (isset($MG_albums[$aid]->id)) {
        if ($MG_albums[$aid]->access >= 1) {
            $orderBy = MG_getSortOrder($aid, 0);
            $sql = "SELECT * FROM {$_TABLES['mg_media_albums']} as ma INNER JOIN " . $_TABLES['mg_media'] . " as m " . " ON ma.media_id=m.media_id WHERE ma.album_id=" . intval($aid) . " AND m.include_ss=1 " . $orderBy;
            $result = DB_query($sql);
            $nRows = DB_numRows($result);
            $mediaRows = 0;
            if ($nRows > 0) {
                while ($row = DB_fetchArray($result)) {
                    if ($row['media_type'] == 0) {
                        foreach ($_MG_CONF['validExtensions'] as $ext) {
                            if (file_exists($_MG_CONF['path_mediaobjects'] . $src . '/' . $row['media_filename'][0] . '/' . $row['media_filename'] . $ext)) {
                                $PhotoURL = $_MG_CONF['mediaobjects_url'] . '/' . $src . "/" . $row['media_filename'][0] . '/' . $row['media_filename'] . $ext;
                                $PhotoPath = $_MG_CONF['path_mediaobjects'] . $src . "/" . $row['media_filename'][0] . '/' . $row['media_filename'] . $ext;
                                break;
                            }
                        }
                        if ($type == 'mini') {
                            $ThumbURL = $_MG_CONF['mediaobjects_url'] . '/' . $src . "/" . $row['media_filename'][0] . '/' . $row['media_filename'] . $ext;
                        } else {
                            foreach ($_MG_CONF['validExtensions'] as $ext) {
                                if (file_exists($_MG_CONF['path_mediaobjects'] . 'tn/' . $row['media_filename'][0] . '/' . $row['media_filename'] . $ext)) {
                                    $ThumbURL = $_MG_CONF['mediaobjects_url'] . '/tn/' . $row['media_filename'][0] . '/' . $row['media_filename'] . $ext;
                                    break;
                                }
                            }
                        }
                        if ($row['remote_url'] != '') {
                            $viewURL = $row['remote_url'];
                        } else {
                            $viewURL = $_MG_CONF['site_url'] . "/media.php?s=" . $row['media_id'];
                        }
                        $imgsize = @getimagesize($PhotoPath);
                        if ($imgsize == false) {
                            continue;
                        }
                        $retval .= "        <item>\n";
                        $retval .= "            <title>" . $row['media_title'] . "</title>\n";
                        $retval .= "            <id>" . $row['media_id'] . "</id>\n";
                        $retval .= "            <link>" . $viewURL . "</link>\n";
                        $retval .= "            <view>" . $PhotoURL . "</view>\n";
                        $retval .= "            <thumbUrl>" . $ThumbURL . "</thumbUrl>\n";
                        $retval .= "            <width>" . $imgsize[0] . "</width>\n";
                        $retval .= "            <height>" . $imgsize[1] . "</height>\n";
                        $retval .= "            <mime>" . $row['mime_type'] . "</mime>\n";
                        $retval .= "            <guid isPermaLink=\"false\">" . $viewURL . "</guid>\n";
                        $retval .= "            <pubDate>" . date('r', $row['media_upload_time']) . "</pubDate>\n";
                        $retval .= "            <media:content url=\"" . $PhotoURL . "\" type=\"" . $row['mime_type'] . "\" width=\"" . $imgsize[0] . "\" height=\"" . $imgsize[1] . "\">\n";
                        $retval .= "               <media:title type=\"plain\">" . cdata($row['media_title']) . "</media:title>\n";
                        $retval .= "               <media:thumbnail url=\"" . $ThumbURL . "\" width=\"" . $imgsize[0] . "\" height=\"" . $imgsize[1] . "\" time=\"" . date('r', $row['media_upload_time']) . "\"/>\n";
                        $retval .= "            </media:content>\n";
                        $retval .= "        </item>\n";
                    }
                }
            }
        }
        return $retval;
    }
}