コード例 #1
0
ファイル: functions.php プロジェクト: baden03/mediapress
/**
 *  Get gallery count by gallery type
 * 
 * @param type $type
 * @param string $owner_type component( members|groups)
 * @param type $owner_id user_id|grup_id etc
 * @param type $status public|private etc
 * @return int
 */
function mpp_get_gallery_count_by_type($type, $owner_type, $owner_id, $status = null)
{
    //check for the vailidity of the gallery type
    if (!mpp_is_registered_gallery_type($type)) {
        return 0;
    }
    //ahh , that's not right
    return mpp_get_gallery_count(array('component' => $owner_type, 'component_id' => $owner_id, 'type' => $type, 'status' => $status));
}
コード例 #2
0
/**
 * Get allowed file extensions for this type as array
 * 
 * @param type $type audio|photo|video etc
 * @return array( 'jpg', 'gif', ..)//allowed extensions for a given type
 */
function mpp_get_allowed_file_extensions($type)
{
    if (!mpp_is_registered_gallery_type($type)) {
        //should we only do it for active types?
        return array();
    }
    $type_object = mpp_get_type_object($type);
    return $type_object->get_allowed_extensions();
}