本文整理汇总了PHP中PMF_Category::transform方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Category::transform方法的具体用法?PHP PMF_Category::transform怎么用?PHP PMF_Category::transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMF_Category
的用法示例。
在下文中一共展示了PMF_Category::transform方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$author = PMF_Filter::filterInput(INPUT_POST, 'author', FILTER_SANITIZE_STRING);
$email = PMF_Filter::filterInput(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
$comment = PMF_Filter::filterInput(INPUT_POST, 'comment', FILTER_SANITIZE_STRING);
$record_id = PMF_Filter::filterInput(INPUT_POST, 'record_id', FILTER_VALIDATE_INT);
$solution_id = PMF_Filter::filterInput(INPUT_POST, 'solution_id', FILTER_VALIDATE_INT);
$revision = PMF_Filter::filterInput(INPUT_POST, 'revision', FILTER_SANITIZE_STRING);
$revision_id = PMF_Filter::filterInput(INPUT_POST, 'revision_id', FILTER_VALIDATE_INT);
$changed = PMF_Filter::filterInput(INPUT_POST, 'changed', FILTER_SANITIZE_STRING);
// Permissions
$user_permission = PMF_Filter::filterInput(INPUT_POST, 'userpermission', FILTER_SANITIZE_STRING);
$restricted_users = 'all' == $user_permission ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_users', FILTER_VALIDATE_INT);
$group_permission = PMF_Filter::filterInput(INPUT_POST, 'grouppermission', FILTER_SANITIZE_STRING);
$restricted_groups = 'all' == $group_permission ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_groups', FILTER_VALIDATE_INT);
if (isset($submit['submit'][2]) && !is_null($question) && !is_null($categories)) {
// Preview
$category->transform(0);
$categorylist = '';
foreach ($categories['rubrik'] as $_categories) {
$categorylist .= $category->getPath($_categories) . '<br />';
}
?>
<h2><?php
print $PMF_LANG["ad_entry_preview"];
?>
</h2>
<h3><strong><em><?php
print $categorylist;
?>
</em>
<?php
示例2: getXMLExport
/**
* Returns the XML export
*
* @param integer $nCatid Number of categories
* @param boolean $bDownwards Downwards
* @param string $lang Language
*
* @return string
*/
public static function getXMLExport($nCatid = 0, $bDownwards = true, $lang = "")
{
global $db, $LANGCODE, $PMF_LANG, $PMF_CONF;
$tree = new PMF_Category();
$tree->transform(0);
$my_xml_output = "<?xml version=\"1.0\" encoding=\"" . $PMF_LANG["metaCharset"] . "\" standalone=\"yes\" ?>\n";
$my_xml_output .= "<!-- XML-Output by phpMyFAQ " . $PMF_CONF['main.currentVersion'] . " | Date: " . PMF_Date::createIsoDate(date("YmdHis")) . " -->\n";
$my_xml_output .= "<phpmyfaq xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:NamespaceSchemaLocation=\"http://www.phpmyfaq.de/xml/faqschema.xsd\">\n";
// Get Faq Data
$oFaq = new PMF_Faq();
$faqs = $oFaq->get(FAQ_QUERY_TYPE_EXPORT_XML, $nCatid, $bDownwards, $lang);
// Start composing XML
if (count($faqs) > 0) {
foreach ($faqs as $faq) {
// Get faq properties
$xml_content = $faq['content'];
$xml_rubrik = $tree->getPath($faq['category_id'], " >> ");
$xml_thema = $faq['topic'];
$xml_keywords = $faq['keywords'];
// Take care of XML entities
$xml_content = strip_tags(PMF_String::htmlspecialchars($xml_content, ENT_QUOTES, $PMF_LANG['metaCharset']));
$xml_rubrik = PMF_htmlentities(strip_tags($xml_rubrik), ENT_QUOTES, $PMF_LANG['metaCharset']);
$xml_thema = strip_tags($xml_thema);
// Build the <article/> node
$my_xml_output .= "\t<article id=\"" . $faq['id'] . "\">\n";
$my_xml_output .= "\t<language>" . $faq['lang'] . "</language>\n";
$my_xml_output .= "\t<category>" . $xml_rubrik . "</category>\n";
if (!empty($xml_keywords)) {
$my_xml_output .= "\t<keywords>" . $xml_keywords . "</keywords>\n";
} else {
$my_xml_output .= "\t<keywords />\n";
}
$my_xml_output .= "\t<theme>" . $xml_thema . "</theme>\n";
$my_xml_output .= "\t<content xmlns=\"http://www.w3.org/TR/REC-html40\">" . $xml_content . "</content>\n";
if (!empty($faq['author_name'])) {
$my_xml_output .= "\t<author>" . $faq['author_name'] . "</author>\n";
} else {
$my_xml_output .= "\t<author />\n";
}
$my_xml_output .= "\t<date>" . PMF_Date::createIsoDate($faq['lastmodified']) . "</date>\n";
$my_xml_output .= "\t</article>\n";
}
}
$my_xml_output .= "</phpmyfaq>";
return $my_xml_output;
}
示例3: header
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
exit;
}
$currentCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
if (!is_null($currentCategory) && isset($category->categoryName[$currentCategory])) {
$faqsession->userTracking('show_category', $currentCategory);
$parent = $category->categoryName[$currentCategory]['parent_id'];
$name = $category->categoryName[$currentCategory]['name'];
$records = $faq->showAllRecords($currentCategory, $faqconfig->get('records.orderby'), $faqconfig->get('records.sortby'));
if (!$records) {
$subCategory = new PMF_Category($current_user, $current_groups, true);
$subCategory->transform($currentCategory);
$records = $subCategory->viewTree();
}
$up = '';
if ($parent != 0) {
$url = sprintf('%saction=show&cat=%d', $sids, $parent);
$oLink = new PMF_Link(PMF_Link::getSystemRelativeUri() . '?' . $url);
$oLink->itemTitle = $category->categoryName[$parent]['name'];
$oLink->text = $PMF_LANG['msgCategoryUp'];
$up = $oLink->toHtmlAnchor();
}
$tpl->processTemplate('writeContent', array('writeCategory' => $PMF_LANG['msgEntriesIn'] . $name, 'writeThemes' => $records, 'writeOneThemeBack' => $up));
$tpl->includeTemplate('writeContent', 'index');
} else {
$faqsession->userTracking('show_all_categories', 0);
$tpl->processTemplate('writeContent', array('writeCategory' => $PMF_LANG['msgFullCategories'], 'writeThemes' => $category->viewTree(), 'writeOneThemeBack' => ''));
示例4: elseif
$category->addPermission('user', $categories['rubrik'], $restricted_users);
// Add group permission
if ($groupSupport) {
$faq->addPermission('group', $record_id, $restricted_groups);
$category->addPermission('group', $categories['rubrik'], $restricted_groups);
}
print $PMF_LANG['ad_entry_savedsuc'];
// Call Link Verification
link_ondemand_javascript($record_id, $recordData['lang']);
} else {
print $PMF_LANG['ad_entry_savedfail'] . $db->error();
}
} elseif (isset($submit['submit'][2]) && !is_null($question) && !is_null($categories)) {
// Preview
$cat = new PMF_Category($current_admin_user, $current_admin_groups, false);
$cat->transform(0);
$categorylist = '';
foreach ($categories['rubrik'] as $_categories) {
$categorylist .= $cat->getPath($_categories) . '<br />';
}
?>
<h3><strong><em><?php
print $categorylist;
?>
</em>
<?php
print $question;
?>
</strong></h3>
<?php
print html_entity_decode($content);