components_node/object-content-details.js
/**
     * Get content listing according to search parameters.
     * @param {*} terminal 0 - backend | 1 - frontend
     * @param {*} returnType 1 - array | 3 - Json Object | 10 - html
     * @returns {json}
     */
Get content listing according to search parameters.
Get content listing according to search parameters .
async recordDetailsGet(terminal = 0, returnType = 1)
    {
        try
        {
            this.resultsContentDetails = await FunctionsDB.genericTableGet02(gSystemConfig.configSystemDBTableContent, 
                                                                            this.arrSearchParameters, 
                                                                            "", 
                                                                            "", 
                                                                            FunctionsGeneric.tableFieldsQueryBuild01(gSystemConfig.configSystemDBTableContent, "all", "string"), 
                                                                            1, 
                                                                            this.objSpecialParameters);
            this.tblContentID = this.resultsContentDetails[0].id;
            this.tblContentIdParent = this.resultsContentDetails[0].id_parent;
            this.tblContentSortOrder = this.resultsContentDetails[0].sort_order;
            this.tblContentSortOrder_print = FunctionsGeneric.valueMaskRead(this.tblContentSortOrder, gSystemConfig.configSystemCurrency, 3);
            this.tblContentDateCreation = this.resultsContentDetails[0].date_creation; 
            this.tblContentDateTimezone = this.resultsContentDetails[0].date_timezone;
            this.tblContentDateEdit = this.resultsContentDetails[0].date_edit;
            this.tblContentIdRegisterUser = this.resultsContentDetails[0].id_register_user;
            this.tblContentContentType = this.resultsContentDetails[0].content_type;
            this.tblContentContentColumns = this.resultsContentDetails[0].content_columns;
            this.tblContentAlignText = this.resultsContentDetails[0].align_text;
            this.tblContentAlignImage = this.resultsContentDetails[0].align_image;
            this.tblContentContentText = FunctionsGeneric.contentMaskRead(this.resultsContentDetails[0].content_text, "db");
            this.tblContentContentText_edit = FunctionsGeneric.contentMaskRead(this.resultsContentDetails[0].content_text, "editTextBox=" + gSystemConfig.configBackendTextBox); 
            this.tblContentContentURL = FunctionsGeneric.contentMaskRead(this.resultsContentDetails[0].content_url, "db");
            this.tblContentCaption = FunctionsGeneric.contentMaskRead(this.resultsContentDetails[0].caption, "db");
            this.tblContentFile = this.resultsContentDetails[0].file;
            this.tblContentFileSize = this.resultsContentDetails[0].file_size;
            this.tblContentFileDuration = this.resultsContentDetails[0].file_duration;
            this.tblContentFileDimensions = this.resultsContentDetails[0].file_dimensions;
            this.tblContentFileOriginalName = this.resultsContentDetails[0].file_original_name;
            this.tblContentFileConfig = this.resultsContentDetails[0].file_config;
            switch(this.tblContentFileConfig)
            {
                case 1:
                    this.tblContentFileConfig_print = FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, this.labelPrefix + "ItemDisplay1");
                    break;
                case 2:
                    this.tblContentFileConfig_print = FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, this.labelPrefix + "ItemDisplay2");
                    break;
                case 3:
                    this.tblContentFileConfig_print = FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, this.labelPrefix + "ItemDisplay3");
                    break;
                case 4:
                    this.tblContentFileConfig_print = FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, this.labelPrefix + "ItemDisplay4");
            }
            this.tblContentFileThumbnail = this.resultsContentDetails[0].file_thumbnail;
            this.tblContentActivation = this.resultsContentDetails[0].activation;
            if(this.tblContentActivation == 0)
            {
                this.tblContentActivation_print = FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, this.labelPrefix + "ItemActivation0");
            }
            if(this.tblContentActivation == 1)
            {
                this.tblContentActivation_print = FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, this.labelPrefix + "ItemActivation1");
            }
        }catch(asyncError){
            if(gSystemConfig.configDebug === true)
            {
                console.log(asyncError)
            }
        }finally{
        }
    }
async recordDetailsGet ( terminal = 0 , returnType = 1 ) { try { this . resultsContentDetails = await FunctionsDB . genericTableGet02 ( gSystemConfig . configSystemDBTableContent , this . arrSearchParameters , "" , "" , FunctionsGeneric . tableFieldsQueryBuild01 ( gSystemConfig . configSystemDBTableContent , "all" , "string" ) , 1 , this . objSpecialParameters ) ; this . tblContentID = this . resultsContentDetails [ 0 ] . id ; this . tblContentIdParent = this . resultsContentDetails [ 0 ] . id_parent ; this . tblContentSortOrder = this . resultsContentDetails [ 0 ] . sort_order ; this . tblContentSortOrder_print = FunctionsGeneric . valueMaskRead ( this . tblContentSortOrder , gSystemConfig . configSystemCurrency , 3 ) ; this . tblContentDateCreation = this . resultsContentDetails [ 0 ] . date_creation ; this . tblContentDateTimezone = this . resultsContentDetails [ 0 ] . date_timezone ; this . tblContentDateEdit = this . resultsContentDetails [ 0 ] . date_edit ; this . tblContentIdRegisterUser = this . resultsContentDetails [ 0 ] . id_register_user ; this . tblContentContentType = this . resultsContentDetails [ 0 ] . content_type ; this . tblContentContentColumns = this . resultsContentDetails [ 0 ] . content_columns ; this . tblContentAlignText = this . resultsContentDetails [ 0 ] . align_text ; this . tblContentAlignImage = this . resultsContentDetails [ 0 ] . align_image ; this . tblContentContentText = FunctionsGeneric . contentMaskRead ( this . resultsContentDetails [ 0 ] . content_text , "db" ) ; this . tblContentContentText_edit = FunctionsGeneric . contentMaskRead ( this . resultsContentDetails [ 0 ] . content_text , "editTextBox=" + gSystemConfig . configBackendTextBox ) ; this . tblContentContentURL = FunctionsGeneric . contentMaskRead ( this . resultsContentDetails [ 0 ] . content_url , "db" ) ; this . tblContentCaption = FunctionsGeneric . contentMaskRead ( this . resultsContentDetails [ 0 ] . caption , "db" ) ; this . tblContentFile = this . resultsContentDetails [ 0 ] . file ; this . tblContentFileSize = this . resultsContentDetails [ 0 ] . file_size ; this . tblContentFileDuration = this . resultsContentDetails [ 0 ] . file_duration ; this . tblContentFileDimensions = this . resultsContentDetails [ 0 ] . file_dimensions ; this . tblContentFileOriginalName = this . resultsContentDetails [ 0 ] . file_original_name ; this . tblContentFileConfig = this . resultsContentDetails [ 0 ] . file_config ; switch ( this . tblContentFileConfig ) { case 1 : this . tblContentFileConfig_print = FunctionsGeneric . appLabelsGet ( gSystemConfig . configLanguageBackend . appLabels , this . labelPrefix + "ItemDisplay1" ) ; break ; case 2 : this . tblContentFileConfig_print = FunctionsGeneric . appLabelsGet ( gSystemConfig . configLanguageBackend . appLabels , this . labelPrefix + "ItemDisplay2" ) ; break ; case 3 : this . tblContentFileConfig_print = FunctionsGeneric . appLabelsGet ( gSystemConfig . configLanguageBackend . appLabels , this . labelPrefix + "ItemDisplay3" ) ; break ; case 4 : this . tblContentFileConfig_print = FunctionsGeneric . appLabelsGet ( gSystemConfig . configLanguageBackend . appLabels , this . labelPrefix + "ItemDisplay4" ) ; } this . tblContentFileThumbnail = this . resultsContentDetails [ 0 ] . file_thumbnail ; this . tblContentActivation = this . resultsContentDetails [ 0 ] . activation ; if ( this . tblContentActivation == 0 ) { this . tblContentActivation_print = FunctionsGeneric . appLabelsGet ( gSystemConfig . configLanguageBackend . appLabels , this . labelPrefix + "ItemActivation0" ) ; } if ( this . tblContentActivation == 1 ) { this . tblContentActivation_print = FunctionsGeneric . appLabelsGet ( gSystemConfig . configLanguageBackend . appLabels , this . labelPrefix + "ItemActivation1" ) ; } } catch ( asyncError ) { if ( gSystemConfig . configDebug === true ) { console . log ( asyncError ) } } finally { } }
Get content listing according to search parameters.
Get content listing according to search parameters .
//terminal: 0 - backend | 1 - frontend //returnType: 1 - array | 3 - Json Object | 10 - html /**/ //Define values. //if(this.resultsCategoryDetails[0]) //{ //DEV: Create logic to chech if record exist. //} //format: yyyy-mm-dd hh:MM:ss or yyyy-mm-dd //TODO: condition detect terminal //Debug. //console.log("this.arrSearchParameters=", this.arrSearchParameters)