Пример #1
0
         $data = $no_message;
     } else {
         $app->enqueueMessage($no_message, $no_style);
     }
 }
 if ($no_action) {
     if ($no_action == 'auto_redirect') {
         if (isset($fields['cck']) && !$fields['cck']->live && $fields['cck']->live_value) {
             $uri = $_SERVER["HTTP_REFERER"];
             $return = base64_encode($uri);
             $redirect_url = JRoute::_('index.php?option=com_cck&view=form&layout=edit&type=' . $fields['cck']->live_value . '&Itemid=' . $config['Itemid'] . '&return=' . $return);
             $app->redirect($redirect_url);
         }
         return;
     } elseif ($no_action == 'file') {
         $templateStyle2 = CCK_List::getTemplateStyle(${$target}->template_list, array('rendering_css_core' => ${$target}->stylesheets));
         $file1 = JPATH_SITE . '/templates/' . $templateStyle2->name . '/includes/' . ${$target}->name . '/no_result.php';
         $file2 = JPATH_SITE . '/templates/' . $templateStyle2->name . '/includes/no_result.php';
         if (file_exists($file1)) {
             $file = $file1;
         } elseif (file_exists($file2)) {
             $file = $file2;
         } else {
             $file = '';
         }
         if ($file && is_file($file)) {
             ob_start();
             include $file;
             $data = ob_get_clean();
         }
     } else {
    }
}
if ($go_for_item || $go_for_both) {
    $client = 'item';
    $fields = CCK_List::getFields_Items($search->name, $client, $access);
    $target_f = 'fields';
    $positions = array();
    $positions_p = CCK_List::getPositions($search->id, $client);
    if ($go_for_both) {
        $fields2 = CCK_List::getFields_Items($search->name, 'list', $access);
        $positions2 = array();
        $positions2_p = CCK_List::getPositions($search->id, 'list');
    }
    // Template
    $P = 'template_item';
    $templateStyleItem = CCK_List::getTemplateStyle($search->{$P}, array('rendering_css_core' => $search->stylesheets));
    if (!$templateStyleItem) {
        $app->enqueueMessage('Oops! Template not found.. ; (', 'error');
        return;
    }
    // Template Override
    $tpl['home'] = $app->getTemplate();
    if (file_exists(JPATH_ADMINISTRATOR . '/templates/' . $tpl['home'] . '/html/tpl_' . $templateStyleItem->name)) {
        $pathI = JPATH_ADMINISTRATOR . '/templates/' . $tpl['home'] . '/html/tpl_' . $templateStyleItem->name;
        $path_rootI = JPATH_ADMINISTRATOR . '/templates/' . $tpl['home'] . '/html';
        $tmplI = 'tpl_' . $templateStyleItem->name;
    } else {
        $pathI = JPATH_SITE . '/templates/' . $templateStyleItem->name;
        $path_rootI = JPATH_SITE . '/templates';
        $tmplI = $templateStyleItem->name;
    }
Пример #3
0
         $data = $no_message;
     } else {
         $app->enqueueMessage($no_message, $no_style);
     }
 }
 if ($no_action) {
     if ($no_action == 'auto_redirect') {
         if (isset($fields['cck']) && !$fields['cck']->live && $fields['cck']->live_value) {
             $uri = $_SERVER["HTTP_REFERER"];
             $return = base64_encode($uri);
             $redirect_url = JRoute::_('index.php?option=com_cck&view=form&layout=edit&type=' . $fields['cck']->live_value . '&Itemid=' . $config['Itemid'] . '&return=' . $return);
             $app->redirect($redirect_url);
         }
         return;
     } elseif ($no_action == 'file') {
         $templateStyle = CCK_List::getTemplateStyle($search->template_list, array('rendering_css_core' => $search->stylesheets));
         $file1 = JPATH_SITE . '/templates/' . $templateStyle->name . '/includes/' . $search->name . '/no_result.php';
         $file2 = JPATH_SITE . '/templates/' . $templateStyle->name . '/includes/no_result.php';
         if (file_exists($file1)) {
             $file = $file1;
         } elseif (file_exists($file2)) {
             $file = $file2;
         } else {
             $file = '';
         }
         if ($file && is_file($file)) {
             ob_start();
             include $file;
             $data = ob_get_clean();
         }
     } else {