当前位置: 首页>>代码示例>>PHP>>正文


PHP AMA_DataHandler类代码示例

本文整理汇总了PHP中AMA_DataHandler的典型用法代码示例。如果您正苦于以下问题:PHP AMA_DataHandler类的具体用法?PHP AMA_DataHandler怎么用?PHP AMA_DataHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AMA_DataHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: videoroom_info

 public function videoroom_info($id_course_instance, $tempo_avvio = NULL, $interval = NULL)
 {
     $dh = $GLOBALS['dh'];
     $error = $GLOBALS['error'];
     $debug = $GLOBALS['debug'];
     $root_dir = $GLOBALS['root_dir'];
     $http_root_dir = $GLOBALS['http_root_dir'];
     $video_roomAr = $dh->get_videoroom_info($id_course_instance, $tempo_avvio, $interval);
     if (AMA_DataHandler::isError($video_roomAr) || !is_array($video_roomAr)) {
         // FIXME: prima restituiva una stringa di testo
         $this->full = 0;
         /*
         $this->id_room = 1;
         $this->id_tutor = 7;
         $this->id = 1;
         $this->descrizione_videochat = "descrizione";
         //    	$this->tempo_avvio = $video_roomAr['tempo_avvio'];
         //    	$this->tempo_fine = $video_roomAr['tempo_fine'];
         $this->tipo_videochat = "pubblica";
         */
     } else {
         $this->id_room = $video_roomAr['id_room'];
         $this->id_tutor = $video_roomAr['id_tutor'];
         $this->id = $video_roomAr['id'];
         $this->id_istanza_corso = $video_roomAr['id_istanza_corso'];
         $this->descrizione_videochat = $video_roomAr['descrizione_videochat'];
         $this->tempo_avvio = $video_roomAr['tempo_avvio'];
         $this->tempo_fine = $video_roomAr['tempo_fine'];
         $this->tipo_videochat = $video_roomAr['tipo_videochat'];
         $this->full = 1;
     }
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:32,代码来源:videoroom_classes_OLD.inc.php

示例2: add_request

function add_request($user_id, $type = 0)
{
    // insert user_id, date, type  into table "requests"
    $date = AMA_DataHandler::date_to_ts("now");
    $token = sha1($date);
    // o altro algoritmo
    $status = ADA_REQUEST_STATUS_SET;
    // insert  $date, $userid, $token, $type, $status
    // if ok:
    return $token;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:11,代码来源:forget_functions.inc.php

示例3: loadSupportedLanguagesInSession

 /**
  * function loadSupportedLanguagesInSession: used to load ADA supported languages for
  * user interface messages translation into a session variable.
  *
  * @return TRUE if there arn't errors, ADA_Error object otherwise
  */
 public static function loadSupportedLanguagesInSession()
 {
     unset($_SESSION['sess_ada_supported_languages']);
     $common_dh = $GLOBALS['common_dh'];
     $supported_languages = array();
     $supported_languages = $common_dh->find_languages();
     if (AMA_DataHandler::isError($supported_languages)) {
         // FIXME: qui si verifica questo errore anche quando c'è un errore di connessione al database.
         $errObj = new ADA_Error($supported_languages, 'No languages for user interface translation were found.', 'Translator');
     }
     $_SESSION['sess_ada_supported_languages'] = $supported_languages;
     return TRUE;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:19,代码来源:translator_class.inc.php

示例4: __construct

 function __construct($id_banner = 0)
 {
     # constructor
     /*
               $user_prefHa = $this->get_user_pref();
     
               //$node_keys is a list of keywords tha can be used to select a banner
               //$node_keysAr = $this->get_node_keys();
               //$node_keys = implode(",",$node_keysAr);
     */
     $dh = $GLOBALS['dh'];
     //$layoutObj = $GLOBALS['layoutObj'];
     $out_fields_ar = array();
     $module = "";
     $keywords = "";
     $client = "";
     $bannerListAr = $dh->find_banner_list($out_fields_ar, $module, $keywords, $client);
     $id_banner = $bannerListAr[0][0];
     $bannerAr = $dh->get_banner($id_banner);
     //$path = $layoutObj->template_dir."img/banners/";
     $path = "layout/clear/img/banners/";
     // TODO: replace
     if (AMA_DataHandler::isError($bannerAr)) {
         $this->error_msg = ADA_ERR_BANNER;
         $this->html_code = "<!-- BANNER NOT FOUND-->\n<!-- END BANNER -->\n";
     } else {
         $this->id_banner = $bannerAr['id_banner'];
         $this->id_client = $bannerAr['id_client'];
         $this->http_address = $bannerAr['address'];
         $this->img = ROOT_DIR . $path . $bannerAr['image'];
         $this->impressions = $bannerAr['impressions'];
         $this->acquired_impressions = $bannerAr['a_impressions'];
         $this->from = $bannerAr['date_from'];
         $this->to = $bannerAr['date_to'];
         $this->keywords = $bannerAr['keywords'];
         $this->module = $bannerAr['module'];
         $this->id_course = $bannerAr['id_course'];
         $this->html_code = "<!-- BANNER -->\n<a href=\"" . $this->http_address . "\" target=_blank><img src=\"" . $this->img . "\" alt=\"" . $this->alt . "\"  width=\"" . $this->width . "\" height=\"" . $this->height . "\" border=\"0\"></a>\n<!-- END BANNER -->\n";
     }
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:40,代码来源:banner.inc.php

示例5: videoroom_info

 public function videoroom_info($id_course_instance, $tempo_avvio = NULL, $interval = NULL)
 {
     $dh = $GLOBALS['dh'];
     $error = $GLOBALS['error'];
     $debug = isset($GLOBALS['debug']) ? $GLOBALS['debug'] : null;
     $root_dir = $GLOBALS['root_dir'];
     $http_root_dir = $GLOBALS['http_root_dir'];
     $video_roomAr = $dh->get_videoroom_info($id_course_instance, $tempo_avvio, $interval);
     if (AMA_DataHandler::isError($video_roomAr) || !is_array($video_roomAr)) {
         $this->full = 0;
     } else {
         $this->id_room = $video_roomAr['id_room'];
         $this->id_tutor = $video_roomAr['id_tutor'];
         $this->id = $video_roomAr['id'];
         $this->id_istanza_corso = $video_roomAr['id_istanza_corso'];
         $this->descrizione_videochat = $video_roomAr['descrizione_videochat'];
         $this->tempo_avvio = $video_roomAr['tempo_avvio'];
         $this->tempo_fine = $video_roomAr['tempo_fine'];
         $this->tipo_videochat = $video_roomAr['tipo_videochat'];
         $this->full = 1;
     }
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:22,代码来源:videoroom.classes.inc.php

示例6: add_chatroomFN

 public static function add_chatroomFN($chatroom_ha, $tester_dsn = null)
 {
     $dh = $GLOBALS['dh'];
     /*
      * Check if was assigned a course instance to this chatroom. If it wasn't,
      * use course instance from request or from session.
      */
     if (!isset($chatroom_ha['id_course_instance']) || empty($chatroom_ha['id_course_instance'])) {
         //get $id_course_instance from the REQUEST variables
         if (!empty($_REQUEST['id_course_instance'])) {
             $id_course_instance = $_REQUEST['id_course_instance'];
         } elseif (!empty($_SESSION['sess_id_course_instance'])) {
             $id_course_instance = $_SESSION['sess_id_course_instance'];
         }
         $chatroom_ha['id_course_instance'] = $id_course_instance;
     }
     // get the user_id form the session variables
     $sess_id_user = $_SESSION['sess_id_user'];
     // get the course title form the GLOBAL variables
     $course_title = $GLOBALS['course_title'];
     /*
      * Check if was assigned a chat owner: if it wasn't, get this course's tutor
      * and set him as chat owner
      */
     if (!isset($chatroom_ha['id_chat_owner']) || empty($chatroom_ha['id_chat_owner'])) {
         $id_tutor = $dh->course_instance_tutor_get($chatroom_ha['id_course_instance']);
         if (!AMA_DataHandler::isError($id_tutor)) {
             $chatroom_ha['id_chat_owner'] = $id_tutor;
         }
     }
     if (!empty($chatroom_ha['chat_type'])) {
         $chatroom_ha['chat_type'] = $chatroom_ha['chat_type'];
     } else {
         $chatroom_ha['chat_type'] = CLASS_CHAT;
     }
     if (!empty($chatroom_ha['chat_title'])) {
         $chatroom_ha['chat_title'] = $chatroom_ha['chat_title'];
     } else {
         $chatroom_ha['chat_title'] = addslashes($course_title);
     }
     if (!empty($chatroom_ha['chat_topic'])) {
         $chatroom_ha['chat_topic'] = $chatroom_ha['chat_topic'];
     } else {
         $chatroom_ha['chat_topic'] = addslashes($course_title);
     }
     // MOVED TO LINE 446
     //      if (isset($chatroom_ha['id_chat_owner'])) {
     //        $chatroom_ha['id_chat_owner']=$chatroom_ha['id_chat_owner'];
     //      }
     //      else {
     //        $chatroom_ha['id_chat_owner']= $id_tutor;
     //      }
     if (!empty($chatroom_ha['start_time'])) {
         $chatroom_ha['start_time'] = $chatroom_ha['start_time'];
     } else {
         $chatroom_ha['start_time'] = time();
     }
     // check again this field
     if (isset($chatroom_ha['end_time'])) {
         $chatroom_ha['end_time'] = $chatroom_ha['end_time'];
     } else {
         $chatroom_ha['end_time'] = time() + SHUTDOWN_CHAT_TIME;
     }
     if (!empty($chatroom_ha['welcome_msg'])) {
         $chatroom_ha['welcome_msg'] = $chatroom_ha['welcome_msg'];
     } else {
         $chatroom_ha['welcome_msg'] = addslashes(translateFN("Benvenuti nella chat di ADA.Ricordatevi di uscire correttamente dalla chat usando l'apposita funzionalita'"));
     }
     if (!empty($chatroom_ha['max_users'])) {
         $chatroom_ha['max_users'] = $chatroom_ha['max_users'];
     } else {
         $chatroom_ha['max_users'] = DEFAULT_MAX_USERS;
     }
     // MOVED TO LINE 422
     //      // check again this field
     //      if(isset($chatroom_ha['id_course_instance'])) {
     //        $chatroom_ha['id_course_instance']=$chatroom_ha['id_course_instance'];
     //      }
     //      else {
     //        $chatroom_ha['id_course_instance']= $id_course_instance;
     //      }
     // write to db and returns the id of the chatroom $id_chatroom.
     //      if (isset($this)) {
     //        $this->chatroom_ha = $chatroom_ha;
     //      }
     $cdh = self::obtainChatDataHandlerInstance();
     $result = $cdh->add_chatroom($chatroom_ha);
     return $result;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:89,代码来源:ChatRoom.inc.php

示例7: getNodeData

function getNodeData($id_node)
{
    $nodeObj = read_node_from_DB($id_node);
    if (AMA_DataHandler::isError($nodeObj)) {
        return $nodeObj;
    }
    $node_data = array('id' => $id_node, 'name' => $nodeObj->name, 'title' => $nodeObj->title, 'text' => $nodeObj->text, 'type' => $nodeObj->type, 'level' => $nodeObj->level, 'parent_id' => $nodeObj->parent_id, 'position' => $nodeObj->position, 'order' => $nodeObj->ordine, 'version' => $nodeObj->version, 'color' => $nodeObj->color, 'bgcolor' => $nodeObj->bgcolor, 'correctness' => $nodeObj->correctness, 'copyright' => $nodeObj->copyright, 'n_contacts' => $nodeObj->contacts, 'icon' => $nodeObj->icon, 'id_node_author' => $nodeObj->author['id'], 'creation_date' => $nodeObj->creation_date, 'id_instance' => $nodeObj->instance);
    if ($nodeObj->type == ADA_LEAF_WORD_TYPE or $nodeObj->type == ADA_GROUP_WORD_TYPE) {
        $node_data['hyphenation'] = $nodeObj->hyphenation;
        $node_data['grammar'] = $nodeObj->grammar;
        $node_data['semantic'] = $nodeObj->semantic;
        $node_data['notes'] = $nodeObj->notes;
        $node_data['examples'] = $nodeObj->examples;
        $node_data['ex_language'] = $nodeObj->language;
    }
    return $node_data;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:17,代码来源:editnode_funcs.inc.php

示例8: array

        // $mh = MessageHandler::instance(MultiPort::getDSN($tester));
        // using the previous  MH if exists
        //if (!isset($mh))
        $mh = MessageHandler::instance(MultiPort::getDSN($tester));
        // prepare message to send
        $destinatari = array($username);
        $message3_ha = array();
        $message3_ha['titolo'] = $titolo;
        $message3_ha['testo'] = $testo;
        $message3_ha['destinatari'] = $destinatari;
        $message3_ha['data_ora'] = "now";
        $message3_ha['tipo'] = ADA_MSG_MAIL;
        $message3_ha['mittente'] = $adm_uname;
        // delegate sending to the message handler
        $res3 = $mh->send_message($message3_ha);
        if (AMA_DataHandler::isError($res3)) {
            // $errObj = new ADA_Error($res,translateFN('Impossibile spedire il messaggio'),
            //NULL,NULL,NULL,$error_page.'?err_msg='.urlencode(translateFN('Impossibile spedire il messaggio')));
        }
        unset($mh);
        $message = urlencode(translateFN("Servizio richiesto correttamente. Ti verrà inviato un messaggio contenente le proposte di appuntamento."));
    } else {
        // a real error
        $message = urlencode(translateFN("Errore nella richiesta di servizio: 2"));
        //$AMAErrorObject=NULL,$errorMessage=NULL, $callerName=NULL, $ADAErrorCode=NULL, $severity=NULL, $redirectTo=NULL, $delayErrorHandling=FALSE
        $errorObj = new ADA_Error($res_presub, $message, NULL, NULL, NULL, $error_page . '?message=' . $message);
    }
} else {
    // id_course is null or was not set
    $error_page = $userObj->getHomePage();
    $message = urlencode(translateFN('Impossibile richiedere il servizio'));
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:subscribe.php

示例9: getAuthorMedia

 public static function getAuthorMedia($id_course, $media_type = array())
 {
     $dh = $GLOBALS['dh'];
     $course_ha = $dh->get_course($id_course);
     if (AMA_DataHandler::isError($course_ha)) {
         return $course_ha;
     }
     $id_author = $course_ha['id_autore'];
     $author_media = $dh->get_risorse_autore($id_author, $media_type);
     return $author_media;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:11,代码来源:NodeEditing.inc.php

示例10: array

 * Users (types) allowed to access this module.
 */
$allowedUsersAr = array(AMA_TYPE_TUTOR);
/**
 * Get needed objects
 */
$neededObjAr = array(AMA_TYPE_TUTOR => array('layout', 'course', 'course_instance'));
require_once ROOT_DIR . '/include/module_init.inc.php';
$self = 'default';
include_once 'include/tutor_functions.inc.php';
include_once 'include/tutor.inc.php';
/*
 * YOUR CODE HERE
 */
$id_course = $courseInstanceObj->id_corso;
$start_date = AMA_DataHandler::ts_to_date($courseInstanceObj->data_inizio, "%d/%m/%Y");
$history = '';
if ($id_course) {
    // get object course
    $courseObj = read_course_from_DB($id_course);
    if (is_object($courseObj) && !AMA_dataHandler::isError($courseObj)) {
        $course_title = $courseObj->titolo;
        //title
        $id_toc = $courseObj->id_nodo_toc;
        //id_toc_node
    } else {
        $errObj = new ADA_error(translateFN("Corso non trovato"), translateFN("Impossibile proseguire."));
    }
}
$studentObj = read_user_from_DB($id_student);
if (is_object($studentObj) && !AMA_dataHandler::isError($studentObj)) {
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:tutor_history_details.php

示例11: translateFN

     * TODO: handle form generation for service with level = 4 and multiple users
     * subscribed.
     */
    $user_infoAr = $users_infoAr[0];
    $id_user = $user_infoAr['id_utente_studente'];
    $tutoredUserObj = MultiPort::findUser($id_user);
    $service_infoAr['id_istanza_corso'] = $id_course_instance;
    $service_infoAr['event_token'] = $event_token;
    /*
     * Check if an eguidance session with this event_token exists. In this case,
     * use this data to fill the form.
     */
    $eguidance_session_dataAr = $dh->get_eguidance_session_with_event_token($event_token);
    if (!AMA_DataHandler::isError($eguidance_session_dataAr)) {
        if ($is_popup) {
            $eguidance_session_dataAr['is_popup'] = true;
        }
        $form = TutorModuleHtmlLib::getEditEguidanceDataForm($tutoredUserObj, $service_infoAr, $eguidance_session_dataAr);
    } else {
        $last_eguidance_session_dataAr = $dh->get_last_eguidance_session($id_course_instance);
        if (AMA_DataHandler::isError($last_eguidance_session_dataAr)) {
            $errObj = new ADA_Error($users_infoAr, translateFN("Errore nell'ottenimento dei dati della precedente sessione di eguidance"), NULL, NULL, NULL, $userObj->getHomePage());
        }
        if ($is_popup) {
            $last_eguidance_session_dataAr['is_popup'] = true;
        }
        $form = TutorModuleHtmlLib::getEguidanceTutorForm($tutoredUserObj, $service_infoAr, $last_eguidance_session_dataAr);
    }
}
$content_dataAr = array('user_name' => $user_name, 'user_type' => $user_type, 'status' => $status, 'dati' => $form->getHtml());
ARE::render($layout_dataAr, $content_dataAr);
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:eguidance_tutor_form.php

示例12: get_all_instancesFN

 function get_all_instancesFN()
 {
     $dh = $GLOBALS['dh'];
     $field_list_ar = array('nome', 'titolo');
     $courses = $dh->get_courses_list($field_list_ar);
     if (AMA_DataHandler::isError($courses)) {
         $msg = $courses->getMessage();
         $classi = $msg;
         // header("Location: $error?err_msg=$msg");
     } else {
         $classe = array();
         $field_list_ar = array('data_inizio', 'durata', 'data_inizio_previsto');
         $num_cl = 0;
         //inizializzazione numero classi
         $corsi = count($courses);
         for ($i = 0; $i < count($courses); $i++) {
             $id_corso_tmp = $courses[$i][0];
             $titolo_tmp = $courses[$i][2];
             $db_data_ar = $dh->course_instance_get_list($field_list_ar, $id_corso_tmp);
             if (AMA_DataHandler::isError($db_data_ar)) {
                 $dati = $db_data_ar->getMessage();
                 $classi = $dati;
                 // header("Location: course_instance.php?status=$dati");
             } else {
                 for ($c = 0; $c < count($db_data_ar); $c++) {
                     $id_istance = $db_data_ar[$c][0];
                     if (!empty($id_istance)) {
                         $classe[$num_cl][0] = $id_corso_tmp;
                         $classe[$num_cl][1] = $titolo_tmp;
                         $classe[$num_cl][2] = $id_istance;
                         $data_inizio = $db_data_ar[$c][3];
                         $classe[$num_cl][3] = $data_inizio;
                         $num_cl++;
                     }
                 }
                 $classi = $classe;
             }
         }
     }
     return $classi;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:41,代码来源:htmladmoutput.inc.php

示例13: today_dateFN

    $event_time = $ora_evento;
}
if (!isset($data_evento)) {
    $event_date = today_dateFN();
} else {
    $event_date = $data_evento;
}
/*
$event_time = today_timeFN();
$event_date = today_dateFN();
*/
$ada_address_book = EventsAddressBook::create($userObj);
$tester_TimeZone = MultiPort::getTesterTimeZone($sess_selected_tester);
$time = time() + get_timezone_offset($tester_TimeZone, SERVER_TIMEZONE);
/*
* Last access link
*/
if (isset($_SESSION['sess_id_course_instance'])) {
    $last_access = $userObj->get_last_accessFN($_SESSION['sess_id_course_instance'], "UT", null);
    $last_access = AMA_DataHandler::ts_to_date($last_access);
} else {
    $last_access = $userObj->get_last_accessFN(null, "UT", null);
    $last_access = AMA_DataHandler::ts_to_date($last_access);
}
if ($last_access == '' || is_null($last_access)) {
    $last_access = '-';
}
$content_dataAr = array('user_name' => $user_name, 'user_type' => $user_type, 'user_level' => $user_level, 'titolo' => $titolo, 'testo' => isset($testo) ? trim($testo) : '', 'destinatari' => isset($destinatari) ? trim($destinatari) : '', 'course_title' => '<a href="../browsing/main_index.php">' . $course_title . '</a>', 'status' => $err_msg, 'timezone' => $tester_TimeZone, 'event_time' => $event_time, 'event_date' => $event_date, 'last_visit' => $last_access, 'rubrica' => $ada_address_book->getHtml(), 'status' => $err_msg);
$options_Ar = array('onload_func' => "load_addressbook();updateClock({$time});");
//$options_Ar .= array('onload_func' => "updateClock($time);");
ARE::render($layout_dataAr, $content_dataAr, NULL, $options_Ar);
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:send_event.php

示例14: translateFN

     $msg = $res->getMessage();
     //                    $dh->course_instance_student_presubscribe_remove($id_course_instance,$id_studente);
     //                    header("Location: $error?err_msg=$msg");
     $message_ha["testo"] = translateFN('Gentile') . " " . $firstname . ",\r\n" . translateFN("Si è verificato un errore nell'iscrizione al corso") . " " . $course_name . "\n\r\n\r";
     $message_ha["testo"] .= $body_mail;
     $message_ha["testo"] .= "\n\r\n\r" . translateFN('Per maggiori informazioni scrivi una mail a:') . " " . ADA_ADMIN_MAIL_ADDRESS;
     $message_ha["testo"] .= "\n\r" . translateFN("Buono studio.");
     $sender_email = ADA_ADMIN_MAIL_ADDRESS;
     $recipients_emails_ar = array($payer_email);
 } else {
     //                  header("Location: $back_url?id_studente=$id_studente");
     // Send mail to the user with his/her data.
     $switcherTypeAr = array(AMA_TYPE_SWITCHER);
     $extended_data = TRUE;
     $switcherList = $dh->get_users_by_type($switcherTypeAr, $extended_data);
     if (!AMA_DataHandler::isError($switcherList)) {
         $switcher_email = $switcherList[0]['e_mail'];
     } else {
         $switcher_email = ADA_ADMIN_MAIL_ADDRESS;
     }
     $switcher_email = 'amministrazione@italicon';
     // versione ICON
     $notice_mail = sprintf(translateFN('Questa è una risposta automatica. Si prega di non rispondere a questa mail. Per informazioni scrivere a %s'), $switcher_email);
     $message_ha["testo"] = $notice_mail . "\n\r\n\r";
     $message_ha["testo"] .= translateFN('Gentile') . " " . $firstname . ",\r\n" . translateFN("grazie per esserti iscritto al corso") . " " . $course_name . "\n\r\n\r";
     $message_ha["testo"] .= $body_mail;
     //$message_ha["testo"] .= "\n\r\n\r". translateFN("Ti ricordiamo i tuoi dati di accesso.\n\r username: ") . $user_name . "\n\r" . translateFN("password:" . " " . $user_password);
     $message_ha["testo"] .= "\n\r\n\r" . translateFN("Questo è l'indirizzo per accedere al corso: ") . "\n\r" . $http_root_dir . "\n\r";
     $message_ha["testo"] .= "\n\r" . translateFN("Una volta fatto il login, potrai accedere al corso");
     $message_ha["testo"] .= "\n\r" . translateFN("Buono studio!");
     $message_ha["testo"] .= "\n\r" . translateFN("La segreteria dei Corsi di Lingua Italiana ICoN");
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:student_course_instance_subscribe_ipn.php

示例15: instance

 /**
  * calls and sets the parent instance method, and if !MULTIPROVIDER
  * checks if module_login_providers table is in the provider db.
  * 
  * If found, use the provider DB else use the common
  * 
  * @param string $dsn
  */
 static function instance($dsn = null)
 {
     if (!MULTIPROVIDER && is_null($dsn)) {
         $dsn = MultiPort::getDSN($GLOBALS['user_provider']);
     }
     $theInstance = parent::instance($dsn);
     if (is_null(self::$dbToUse)) {
         self::$dbToUse = AMA_Common_DataHandler::instance();
         if (!MULTIPROVIDER && !is_null($dsn)) {
             // must check if passed $dsn has the module login tables
             // execute this dummy query, if result is not an error table is there
             $sql = 'SELECT NULL FROM `' . self::$PREFIX . 'providers`';
             // must use AMA_DataHandler because we are not able to
             // query AMALoginDataHandelr in this method!
             $ok = AMA_DataHandler::instance($dsn)->getOnePrepared($sql);
             if (!AMA_DB::isError($ok)) {
                 self::$dbToUse = $theInstance;
             }
         }
     }
     return $theInstance;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:30,代码来源:AMALoginDataHandler.inc.php


注:本文中的AMA_DataHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。