本文整理汇总了PHP中content::getTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP content::getTemplate方法的具体用法?PHP content::getTemplate怎么用?PHP content::getTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类content
的用法示例。
在下文中一共展示了content::getTemplate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once '../../admin-includes/admin.base.inc.php';
require_once '../../admin-includes/admin.security_ajax.inc.php';
$content = new content();
// TO DO - security later - e.g. is this user allowed
$userID = $_SESSION['userID'];
if (isset($_POST['action'])) {
////////////////////////////////////////////////////
// getTemplate Get template from the content BY ID
////////////////////////////////////////////////////
if ($_POST['action'] == 'getTemplate') {
if (isset($_POST['nodeID']) && is_int((int) $_POST['nodeID']) && isset($_POST['languageID']) && is_int((int) $_POST['languageID'])) {
$foundRecord = $content->getTemplate((int) $_POST['nodeID'], (int) $_POST['languageID']);
if ($foundRecord !== true) {
echo json_encode(array('result' => false, 'msg' => 'No template available in the database'));
exit;
} else {
echo json_encode(array('result' => $foundRecord, 'msg' => 'Template found!', 'results' => $content->template, 'sectionInstances' => $content->sectionInstances, 'tabs' => $content->tabs, 'sections' => $content->sections));
exit;
}
} else {
echo json_encode(array('result' => false, 'msg' => 'AJAX Validation failed'));
exit;
}
}
////////////////////////////////////////////////////
// loadContent Content BY ID
////////////////////////////////////////////////////